Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.api.views.test_vault::Tests / Python tests / test_api_vault_cook
Failed

TEST RESULT

Run At
Sep 3 2021, 2:02 PM
Details
api_client = <rest_framework.test.APIClient object at 0x7f0d40e8fcc0> mocker = <pytest_mock.plugin.MockerFixture object at 0x7f0d40e8f550> @given(directory(), revision()) > def test_api_vault_cook(api_client, mocker, directory, revision): .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_vault.py:32: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ api_client = <rest_framework.test.APIClient object at 0x7f0d40e8fcc0> mocker = <pytest_mock.plugin.MockerFixture object at 0x7f0d40e8f550> directory = '50f4ff2e9b4b41d34bf4038fbc202dc3c34b9b7a' revision = 'a43504d78a5695ca07cf3706e34abfdfd5b4343b' @given(directory(), revision()) def test_api_vault_cook(api_client, mocker, directory, revision): mock_archive = mocker.patch("swh.web.api.views.vault.archive") for bundle_type, swhid in ( ("flat", f"swh:1:dir:{directory}"), ("gitfast", f"swh:1:rev:{revision}"), ("git_bare", f"swh:1:rev:{revision}"), ): fetch_url = reverse( f"api-1-vault-fetch-{bundle_type.replace('_', '-')}", url_args={"swhid": swhid}, ) stub_cook = { "type": bundle_type, "progress_msg": None, "task_id": 1, "task_status": "done", "swhid": swhid, } stub_fetch = b"content" mock_archive.vault_cook.return_value = stub_cook mock_archive.vault_fetch.return_value = stub_fetch email = "test@test.mail" url = reverse( f"api-1-vault-cook-{bundle_type.replace('_', '-')}", url_args={"swhid": swhid}, query_params={"email": email}, ) rv = check_api_post_responses(api_client, url, data=None, status_code=200) assert rv.data == { "fetch_url": rv.wsgi_request.build_absolute_uri(fetch_url), "progress_message": None, "id": 1, "status": "done", "swhid": swhid, } mock_archive.vault_cook.assert_called_with( bundle_type, CoreSWHID.from_string(swhid), email ) rv = check_http_get_response(api_client, fetch_url, status_code=200) > assert rv["Content-Type"] == "application/gzip" E AssertionError: assert 'application/x-tar' == 'application/gzip' E - application/gzip E + application/x-tar .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_vault.py:77: AssertionError