self = <swh.model.tests.test_from_disk.DirectoryToObjects testMethod=test_directory_to_objects>
def test_directory_to_objects(self):
directory = Directory.from_disk(path=self.tmpdir_name)
for name, value in self.contents.items():
> self.assertContentEqual(directory[b"contents/" + name], value)
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_from_disk.py:706:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.model.tests.test_from_disk.DirectoryToObjects testMethod=test_directory_to_objects>
left = Content(id=34973274ccef6ab4dfaaf86599792fa9c3fe4689)
right = {'blake2s256': b"\xd5\xfe\x199We'\xe4,\xfdv\xa9EZ$2\xfe\x7fVf\x95dW}\xd9<B\x80\xe7mf\x1d", 'data': b'42\n', 'length': 3, 'mode': 33188, ...}
def assertContentEqual(self, left, right, *, check_path=False): # noqa
if not isinstance(left, Content):
raise ValueError("%s is not a Content" % left)
if isinstance(right, Content):
right = right.get_data()
# Compare dictionaries
keys = DEFAULT_ALGORITHMS | {
"length",
"perms",
}
if check_path:
keys |= {"path"}
failed = []
for key in keys:
try:
lvalue = left.data[key]
if key == "perms" and "perms" not in right:
rvalue = from_disk.mode_to_perms(right["mode"])
else:
rvalue = right[key]
except KeyError:
failed.append(key)
continue
if lvalue != rvalue:
failed.append(key)
if failed:
raise self.failureException(
"Content mismatched:\n"
+ "\n".join(
"content[%s] = %r != %r" % (key, left.data.get(key), right.get(key))
> for key in failed
)
)
E AssertionError: Content mismatched:
E content[sha1_git] = b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89' != b'\xd8\x1c\xc0q\x0e\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xb6\xcd'
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_from_disk.py:483: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 30 2021, 12:26 PM