self = <swh.model.tests.test_from_disk.FileToContent testMethod=test_file_to_content_with_path>
def test_file_to_content_with_path(self):
for filename, content in self.contents.items():
content_w_path = content.copy()
path = os.path.join(self.tmpdir_name, filename)
content_w_path["path"] = path
conv_content = Content.from_file(path=path)
> self.assertContentEqual(conv_content, content_w_path, check_path=True)
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_from_disk.py:683:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.model.tests.test_from_disk.FileToContent testMethod=test_file_to_content_with_path>
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