self = <swh.loader.git.tests.test_converters.TestConverters object at 0x7f491bc9d048>
def test_weird_tag(self):
"""Checks raw_manifest is set when the tag cannot fit the data model"""
# Well-formed manifest
raw_manifest = (
b"object 641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce\n"
b"type commit\n"
b"tag blah\n"
b"tagger Foo <foo@example.org> 1640191027 +0200\n\n"
b"some release message"
)
tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest)
assert converters.dulwich_tag_to_release(tag) == Release(
name=b"blah",
message=b"some release message",
target=hash_to_bytes("641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce"),
target_type=ObjectType.REVISION,
synthetic=False,
author=Person.from_fullname(b"Foo <foo@example.org>",),
date=TimestampWithTimezone(
timestamp=Timestamp(seconds=1640191027, microseconds=0),
offset=120,
negative_utc=False,
offset_bytes=b"+0200",
),
raw_manifest=None,
)
# Mess with the offset
raw_manifest2 = raw_manifest.replace(b"+0200", b"+200")
tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest2)
> assert converters.dulwich_tag_to_release(tag) == Release(
name=b"blah",
message=b"some release message",
target=hash_to_bytes("641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce"),
target_type=ObjectType.REVISION,
synthetic=False,
author=Person.from_fullname(b"Foo <foo@example.org>",),
date=TimestampWithTimezone(
timestamp=Timestamp(seconds=1640191027, microseconds=0),
offset=120,
negative_utc=False,
offset_bytes=b"+200",
),
)
E AssertionError: assert Release(name=...ease message') == Release(name=...manifest=None)
E
E Omitting 8 identical items, use -vv to show
E Differing attributes:
E ['id', 'raw_manifest']
E
E Drill down into differing attribute id:
E id: b'%CaQ\xe1\x99\x08(\x0b\xfa\xd2-\xe0\n\xbe\x81\xc0\x8cxM' != b'/\x80\xdb\r\xc9rU:\xec\x945\xee3<\x0e\xd7\r\x1bCG'...
E
E ...Full output truncated (10 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/loader/git/tests/test_converters.py:624: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jan 7 2022, 5:30 PM