Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_api_client.TestStorageApi::test_content_get_data_full_dict
Failed

TEST RESULT

Run At
Jul 18 2022, 2:27 PM
Details
self = <swh.storage.tests.test_api_client.TestStorageApi object at 0x7f5995803c18> swh_storage = <RemoteStorage url=mock://example.com/> swh_storage_backend = <swh.storage.in_memory.InMemoryStorage object at 0x7f598fdd0ac8> sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f598f6ccb70> mocker = <pytest_mock.plugin.MockerFixture object at 0x7f598f6cc438> def test_content_get_data_full_dict( self, swh_storage, swh_storage_backend, sample_data, mocker ): cont = sample_data.content swh_storage.content_add([cont]) content_find = mocker.patch.object( swh_storage_backend, "content_find", wraps=swh_storage_backend.content_find ) > assert swh_storage.content_get_data(cont.hashes()) == cont.data .tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:287: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:183: in meth_ return self._post(meth._endpoint_path, post_data) .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:278: in _post return self._decode_response(response) .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:370: in _decode_response self.raise_for_status(response) .tox/py3/lib/python3.7/site-packages/swh/storage/api/client.py:29: in raise_for_status super().raise_for_status(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <RemoteStorage url=mock://example.com/>, response = <Response [500]> def raise_for_status(self, response) -> None: """check response HTTP status code and raise an exception if it denotes an error; do nothing otherwise """ status_code = response.status_code status_class = response.status_code // 100 if status_code == 404: raise RemoteException(payload="404 not found", response=response) exception = None # TODO: only old servers send pickled error; stop trying to unpickle # after they are all upgraded try: if status_class == 4: data = self._decode_response(response, check_status=False) if isinstance(data, dict): # TODO: remove "exception" key check once all servers # are using new schema exc_data = data["exception"] if "exception" in data else data for exc_type in self.reraise_exceptions: if exc_type.__name__ == exc_data["type"]: exception = exc_type(*exc_data["args"]) break else: exception = RemoteException(payload=exc_data, response=response) else: exception = pickle.loads(data) elif status_class == 5: data = self._decode_response(response, check_status=False) if "exception_pickled" in data: exception = pickle.loads(data["exception_pickled"]) else: # TODO: remove "exception" key check once all servers # are using new schema exc_data = data["exception"] if "exception" in data else data exception = RemoteException(payload=exc_data, response=response) except (TypeError, pickle.UnpicklingError): raise RemoteException(payload=data, response=response) if exception: > raise exception from None E swh.core.api.RemoteException: <RemoteException 500 TypeError: ["unhashable type: 'dict'"]> .tox/py3/lib/python3.7/site-packages/swh/core/api/__init__.py:360: RemoteException