def test_db_to_revision():
# when
actual_revision = converters.db_to_revision(
{
"id": "revision-id",
"date": None,
"date_offset": None,
"date_neg_utc_offset": None,
"committer_date": None,
"committer_date_offset": None,
"committer_date_neg_utc_offset": None,
"type": "rev",
"directory": b"dir-sha1",
"message": b"commit message",
"author_fullname": b"auth-fullname",
"author_name": b"auth-name",
"author_email": b"auth-email",
"committer_fullname": b"comm-fullname",
"committer_name": b"comm-name",
"committer_email": b"comm-email",
"metadata": {},
"synthetic": False,
"extra_headers": (),
"parents": [123, 456],
}
)
# then
> assert actual_revision == {
"id": "revision-id",
"author": {
"fullname": b"auth-fullname",
"name": b"auth-name",
"email": b"auth-email",
},
"date": None,
"committer": {
"fullname": b"comm-fullname",
"name": b"comm-name",
"email": b"comm-email",
},
"committer_date": None,
"type": "rev",
"directory": b"dir-sha1",
"message": b"commit message",
"metadata": {},
"synthetic": False,
"extra_headers": (),
"parents": [123, 456],
}
E AssertionError: assert {'author': {'...e': None, ...} == {'author': {'...e': None, ...}
E Omitting 11 identical items, use -vv to show
E Differing items:
E {'parents': (123, 456)} != {'parents': [123, 456]}
E Full diff:
E {
E 'author': {'email': b'auth-email',
E 'fullname': b'auth-fullname',...
E
E ...Full output truncated (19 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_converters.py:94: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 21 2020, 9:55 AM