api_client = <rest_framework.test.APIClient object at 0x7fe749f86240>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fe749f862e8>
release = '6877028d6e5412780517d0bfa81f07f6c51abb41'
def test_api_raw_release(api_client, archive_data, release):
> _test_api_raw_hash(api_client, archive_data, release, "rel")
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_raw.py:56:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
api_client = <rest_framework.test.APIClient object at 0x7fe749f86240>
archive_data = <swh.web.tests.conftest._ArchiveData object at 0x7fe749f862e8>
object_id = '6877028d6e5412780517d0bfa81f07f6c51abb41', object_ty = 'rel'
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'hw\x02\x8dnT\x12x\x05\x17\xd0\xbf\xa8\x1f\x07\xf6\xc5\x1a\xbbA' == '6877028d6e5412780517d0bfa81f07f6c51abb41'
.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