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_notfound_legacy
Failed

TEST RESULT

Run At
May 25 2022, 4:46 PM
Details
api_client = <rest_framework.test.APIClient object at 0x7f45dd89c400> mocker = <pytest_mock.plugin.MockerFixture object at 0x7f45dd89ca58> directory = '04046f0d4da224462a9eff42b42dbf91d56c99cc' revision = 'd7c52cd81010768c4a51b6ad468fc95cb84e2858' unknown_directory = '8011227ca847ee3a93b02bd9e3dae4685ac7b8db' unknown_revision = 'b53277bc66eef52d832b4a4d833cb22b408845c9' def test_api_vault_cook_notfound_legacy( api_client, mocker, directory, revision, unknown_directory, unknown_revision ): mock_vault = mocker.patch("swh.web.common.archive.vault") mock_vault.cook.side_effect = NotFoundExc("object not found") mock_vault.fetch.side_effect = NotFoundExc("cooked archive not found") mock_vault.progress.side_effect = NotFoundExc("cooking request not found") for obj_type, bundle_type, obj_id in ( ("directory", "flat", directory), ("revision_gitfast", "gitfast", revision), ): url = reverse( f"api-1-vault-cook-{obj_type}", url_args={f"{obj_type[:3]}_id": obj_id}, ) swhid = CoreSWHID.from_string(f"swh:1:{obj_type[:3]}:{obj_id}") > rv = check_api_get_responses(api_client, url, status_code=404) .tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_vault.py:293: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:131: in check_api_get_responses check_http_get_response(api_client, url, status_code, content_type="text/html") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ client = <rest_framework.test.APIClient object at 0x7f45dd89c400> url = '/api/1/vault/directory/04046f0d4da224462a9eff42b42dbf91d56c99cc/' status_code = 404, content_type = 'text/html', http_origin = None server_name = None def check_http_get_response( client: Client, url: str, status_code: int, content_type: str = "*/*", http_origin: Optional[str] = None, server_name: Optional[str] = None, ) -> HttpResponse: """Helper function to check HTTP response for a GET request. Args: client: Django test client url: URL to check response status_code: expected HTTP status code content_type: expected response content type http_origin: optional HTTP_ORIGIN header value Returns: The HTTP response """ actual_response = client.get( url, HTTP_ACCEPT=content_type, HTTP_ORIGIN=http_origin, SERVER_NAME=server_name if server_name else "testserver", ) > assert isinstance(actual_response, Response) E assert False E + where False = isinstance(<HttpResponse status_code=404, "text/html; charset=utf-8">, Response) .tox/py3/lib/python3.7/site-packages/swh/web/tests/utils.py:66: AssertionError