diff --git a/swh/loader/git/tests/test_converters.py b/swh/loader/git/tests/test_converters.py --- a/swh/loader/git/tests/test_converters.py +++ b/swh/loader/git/tests/test_converters.py @@ -189,14 +189,14 @@ def test_weird_tree(self): """Tests a tree with entries the wrong order""" - raw_manifest = ( + raw_string = ( b"0644 file2\x00" b"d\x1f\xb6\xe0\x8d\xdb.O\xd0\x96\xdc\xf1\x8e\x80\xb8\x94\xbf~%\xce" b"0644 file1\x00" b"d\x1f\xb6\xe0\x8d\xdb.O\xd0\x96\xdc\xf1\x8e\x80\xb8\x94\xbf~%\xce" ) - tree = dulwich.objects.Tree.from_raw_string(b"tree", raw_manifest) + tree = dulwich.objects.Tree.from_raw_string(b"tree", raw_string) assert converters.dulwich_tree_to_directory(tree) == Directory( entries=( @@ -214,7 +214,7 @@ perms=0o644, ), ), - raw_manifest=b"tree 62\x00" + raw_manifest, + raw_manifest=b"tree 62\x00" + raw_string, ) def test_tree_perms(self): @@ -438,13 +438,13 @@ """Checks raw_manifest is set when the commit cannot fit the data model""" # Well-formed manifest - raw_manifest = ( + raw_string = ( b"tree 641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce\n" b"author Foo 1640191028 +0200\n" b"committer Foo 1640191028 +0200\n\n" b"some commit message" ) - commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_manifest) + commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_string) date = TimestampWithTimezone( timestamp=Timestamp(seconds=1640191028, microseconds=0), offset_bytes=b"+0200", @@ -466,8 +466,8 @@ ) # Mess with the offset - raw_manifest2 = raw_manifest.replace(b"+0200", b"+200") - commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_manifest2) + raw_string2 = raw_string.replace(b"+0200", b"+200") + commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_string2) date = TimestampWithTimezone( timestamp=Timestamp(seconds=1640191028, microseconds=0), offset_bytes=b"+200", @@ -489,11 +489,11 @@ ) # Mess with the rest of the manifest - raw_manifest2 = raw_manifest.replace( + raw_string2 = raw_string.replace( b"641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce", b"641FB6E08DDB2E4FD096DCF18E80B894BF7E25CE", ) - commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_manifest2) + commit = dulwich.objects.Commit.from_raw_string(b"commit", raw_string2) date = TimestampWithTimezone( timestamp=Timestamp(seconds=1640191028, microseconds=0), offset_bytes=b"+0200", @@ -511,7 +511,7 @@ date=date, committer_date=date, type=RevisionType.GIT, - raw_manifest=b"commit 161\x00" + raw_manifest2, + raw_manifest=b"commit 161\x00" + raw_string2, ) def test_author_line_to_author(self): @@ -787,14 +787,14 @@ """Checks raw_manifest is set when the tag cannot fit the data model""" # Well-formed manifest - raw_manifest = ( + raw_string = ( b"object 641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce\n" b"type commit\n" b"tag blah\n" b"tagger Foo 1640191027 +0200\n\n" b"some release message" ) - tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest) + tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_string) assert converters.dulwich_tag_to_release(tag) == Release( name=b"blah", message=b"some release message", @@ -812,8 +812,8 @@ ) # Mess with the offset (negative UTC) - raw_manifest2 = raw_manifest.replace(b"+0200", b"-0000") - tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest2) + raw_string2 = raw_string.replace(b"+0200", b"-0000") + tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_string2) assert converters.dulwich_tag_to_release(tag) == Release( name=b"blah", message=b"some release message", @@ -830,8 +830,8 @@ ) # Mess with the offset (other) - raw_manifest2 = raw_manifest.replace(b"+0200", b"+200") - tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest2) + raw_string2 = raw_string.replace(b"+0200", b"+200") + tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_string2) assert converters.dulwich_tag_to_release(tag) == Release( name=b"blah", message=b"some release message", @@ -848,11 +848,11 @@ ) # Mess with the rest of the manifest - raw_manifest2 = raw_manifest.replace( + raw_string2 = raw_string.replace( b"641fb6e08ddb2e4fd096dcf18e80b894bf7e25ce", b"641FB6E08DDB2E4FD096DCF18E80B894BF7E25CE", ) - tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_manifest2) + tag = dulwich.objects.Tag.from_raw_string(b"tag", raw_string2) assert converters.dulwich_tag_to_release(tag) == Release( name=b"blah", message=b"some release message", @@ -866,5 +866,5 @@ timestamp=Timestamp(seconds=1640191027, microseconds=0), offset_bytes=b"+0200", ), - raw_manifest=b"tag 136\x00" + raw_manifest2, + raw_manifest=b"tag 136\x00" + raw_string2, )