diff --git a/apiserver/main.py b/apiserver/main.py index 3c94d014e19c1196f8aa954a592548938da20533..c4c97d83035a7a68023298d241ac7c929ad6fb57 100644 --- a/apiserver/main.py +++ b/apiserver/main.py @@ -109,10 +109,9 @@ async def delete_specific_dataset(location_data_type: LocationDataType, return adapter.delete(location_data_type, dataset_id, user.username) - @app.exception_handler(FileNotFoundError) async def not_found_handler(request: Request, ex: FileNotFoundError): - oid=request.path_params.get('dataset_id', '') + _ =request.path_params.get('dataset_id', '') logging.error("File not found translated %s", ex) return JSONResponse(status_code=status.HTTP_404_NOT_FOUND, - content={'message':f"Object {oid} does not exist"}) + content={'message':f"Object does not exist"}) diff --git a/tests/apiserver_tests/test_responsiveness.py b/tests/apiserver_tests/test_responsiveness.py index 621dba375ceb92afc3f0a5df809031db0465504c..7a65933ffba5f6fec4cf977e36c4557468c69a68 100644 --- a/tests/apiserver_tests/test_responsiveness.py +++ b/tests/apiserver_tests/test_responsiveness.py @@ -42,5 +42,5 @@ class NonAuthTests(unittest.TestCase): self.assertEqual(404, rsp.status_code) j = rsp.json() self.assertTrue('message' in j, f"{j} should contain message") - self.assertTrue('foo' in j['message'], f"{j} should contain object id (foo)") + self.assertFalse('foo' in j['message'], f"error message should contain object id (foo)") diff --git a/tests/storage_tests/test_jsonbackend.py b/tests/storage_tests/test_jsonbackend.py index f9770809cf411bd658fc23f5d239663b1bfa778f..2abc405e5e8109b927388e88458cb510c5917e37 100644 --- a/tests/storage_tests/test_jsonbackend.py +++ b/tests/storage_tests/test_jsonbackend.py @@ -96,6 +96,7 @@ class SomeTests(unittest.TestCase): details = self.store.get_details(n_type=LocationDataType.DATASET, oid='../../../tmp/hackme') except: pass + print(details) self.assertIsNone(details)