credentials = {'cgit': {'pypi': [{'password': 'pass', 'username': 'user'}]}}
expected_credentials = [{'password': 'pass', 'username': 'user'}]
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f76cccc1898>
@pytest.mark.parametrize(
"credentials, expected_credentials",
[
(None, []),
({"key": "value"}, []),
(
{"cgit": {"pypi": [{"username": "user", "password": "pass"}]}},
[{"username": "user", "password": "pass"}],
),
],
)
def test_lister_cgit_instantiation_with_credentials(
credentials, expected_credentials, swh_scheduler
):
lister = PyPILister(swh_scheduler, credentials=credentials)
# Credentials are allowed in constructor
> assert lister.credentials == expected_credentials
E AssertionError: assert [] == [{'password':...ame': 'user'}]
E Right contains one more item: {'password': 'pass', 'username': 'user'}
E Full diff:
E - [{'password': 'pass', 'username': 'user'}]
E + []
.tox/py3/lib/python3.7/site-packages/swh/lister/pypi/tests/test_lister.py:100: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jan 28 2021, 2:32 PM