mocker = <pytest_mock.plugin.MockerFixture object at 0x7f56be9ed4a8>
def test_auth_login(mocker):
mock_getpass = mocker.patch("swh.web.client.cli.getpass")
mock_getpass.return_value = "password"
mock_oidc_session = mocker.patch("swh.web.client.cli.OpenIDConnectSession")
mock_login = mock_oidc_session.return_value.login
mock_login.return_value = oidc_profile
result = runner.invoke(auth, ["login", "username"], input="password\n")
assert result.exit_code == 0
> assert json.loads(result.output) == oidc_profile
.tox/py3/lib/python3.7/site-packages/swh/web/client/tests/test_cli.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/json/__init__.py:348: in loads
return _default_decoder.decode(s)
/usr/lib/python3.7/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.decoder.JSONDecoder object at 0x7f56bfcbe320>
s = 'some-refresh-token\n', idx = 0
def raw_decode(self, s, idx=0):
"""Decode a JSON document from ``s`` (a ``str`` beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
/usr/lib/python3.7/json/decoder.py:355: JSONDecodeError
TEST RESULT
TEST RESULT
- Run At
- Aug 27 2020, 1:43 PM