release = Release(name=b'', message=None, target=hash_to_bytes('0000000000000000000000000000000000000000'), target_type=ObjectTy...hor=None, date=None, metadata=None, id=hash_to_bytes('5ba93c9db0cff93f52b521d7420e43f6eda2784f'), raw_manifest=b'\x00')
@given(strategies.releases())
def test_release_check(release):
release.check()
release2 = attr.evolve(release, id=b"\x00" * 20)
with pytest.raises(ValueError, match="does not match recomputed hash"):
release2.check()
release2 = attr.evolve(
release, raw_manifest=swh.model.git_objects.release_git_object(release)
)
with pytest.raises(
ValueError, match="non-none raw_manifest attribute, but does not need it."
):
> release2.check()
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:830:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Release(name=b'', message=None, target=hash_to_bytes('0000000000000000000000000000000000000000'), target_type=ObjectTy...b521d7420e43f6eda2784f'), raw_manifest=b'tag 63\x00object 0000000000000000000000000000000000000000\ntype blob\ntag \n')
def check(self) -> None:
> super().check()
.tox/py3-full/lib/python3.7/site-packages/swh/model/model.py:272:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Release(name=b'', message=None, target=hash_to_bytes('0000000000000000000000000000000000000000'), target_type=ObjectTy...b521d7420e43f6eda2784f'), raw_manifest=b'tag 63\x00object 0000000000000000000000000000000000000000\ntype blob\ntag \n')
def check(self) -> None:
super().check() # type: ignore
if self.id != self.compute_hash():
> raise ValueError("'id' does not match recomputed hash.")
E ValueError: 'id' does not match recomputed hash.
.tox/py3-full/lib/python3.7/site-packages/swh/model/model.py:239: ValueError
During handling of the above exception, another exception occurred:
@given(strategies.releases())
> def test_release_check(release):
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:817:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
release = Release(name=b'', message=None, target=hash_to_bytes('0000000000000000000000000000000000000000'), target_type=ObjectTy...hor=None, date=None, metadata=None, id=hash_to_bytes('5ba93c9db0cff93f52b521d7420e43f6eda2784f'), raw_manifest=b'\x00')
@given(strategies.releases())
def test_release_check(release):
release.check()
release2 = attr.evolve(release, id=b"\x00" * 20)
with pytest.raises(ValueError, match="does not match recomputed hash"):
release2.check()
release2 = attr.evolve(
release, raw_manifest=swh.model.git_objects.release_git_object(release)
)
with pytest.raises(
ValueError, match="non-none raw_manifest attribute, but does not need it."
):
> release2.check()
E AssertionError: Regex pattern 'non-none raw_manifest attribute, but does not need it.' does not match "'id' does not match recomputed hash.".
.tox/py3-full/lib/python3.7/site-packages/swh/model/tests/test_model.py:830: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Dec 15 2021, 6:56 PM