api_client = <rest_framework.test.APIClient object at 0x7fe749e79908>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fe749e799b0>
snapshot = '99ce72dbb2679eb6962ab9bbf85152857bba81a2'
def test_api_raw_snapshot(api_client, archive_data, snapshot):
> _test_api_raw_hash(api_client, archive_data, snapshot, "snp")
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_raw.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
api_client = <rest_framework.test.APIClient object at 0x7fe749e79908>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fe749e799b0>
object_id = '99ce72dbb2679eb6962ab9bbf85152857bba81a2', object_ty = 'snp'
def _test_api_raw_hash(api_client, archive_data, object_id, object_ty):
url = reverse(
"api-1-raw-object",
url_args={"swhid": f"swh:1:{object_ty}:{object_id}"},
)
rv = check_http_get_response(api_client, url, status_code=200)
assert rv["Content-Type"] == "application/octet-stream"
assert (
rv["Content-disposition"]
== f"attachment; filename=swh_1_{object_ty}_{object_id}_raw"
)
sha1_git = hashlib.new("sha1", rv.content).digest()
> assert sha1_git == object_id
E AssertionError: assert b'\x99\xcer\xdb\xb2g\x9e\xb6\x96*\xb9\xbb\xf8QR\x85{\xba\x81\xa2' == '99ce72dbb2679eb6962ab9bbf85152857bba81a2'
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_raw.py:40: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Apr 27 2022, 11:36 PM