From 013502b4024010cd1141ac2861f39f7a92f6ed9d Mon Sep 17 00:00:00 2001 From: Christian Boettcher <c.boettcher@fz-juelich.de> Date: Wed, 26 May 2021 11:24:54 +0200 Subject: [PATCH] rename testing files, add comments for future tests --- .../apiserver_tests}/context.py | 0 tests/apiserver_tests/test_put.py | 12 ++++++++++++ .../apiserver_tests}/test_responsiveness.py | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) rename {apiserver_tests => tests/apiserver_tests}/context.py (100%) create mode 100644 tests/apiserver_tests/test_put.py rename {apiserver_tests => tests/apiserver_tests}/test_responsiveness.py (86%) diff --git a/apiserver_tests/context.py b/tests/apiserver_tests/context.py similarity index 100% rename from apiserver_tests/context.py rename to tests/apiserver_tests/context.py diff --git a/tests/apiserver_tests/test_put.py b/tests/apiserver_tests/test_put.py new file mode 100644 index 0000000..3c435a8 --- /dev/null +++ b/tests/apiserver_tests/test_put.py @@ -0,0 +1,12 @@ +# These Tests check if the PUT calls work as intended, checking both valid puts and invalid puts + +from fastapi.testclient import TestClient + +from context import apiserver +from context import storage + +client = TestClient(apiserver.app) + +# PUT a new dataset, store the id in global variable, verify via a GET if it worked + +# PUT an invalid type (i.e. a type not in the enum) diff --git a/apiserver_tests/test_responsiveness.py b/tests/apiserver_tests/test_responsiveness.py similarity index 86% rename from apiserver_tests/test_responsiveness.py rename to tests/apiserver_tests/test_responsiveness.py index 7838446..04cde63 100644 --- a/apiserver_tests/test_responsiveness.py +++ b/tests/apiserver_tests/test_responsiveness.py @@ -17,4 +17,10 @@ def test_root(): def test_types(): for location_type in storage.LocationDataType: rsp = client.get('/' + location_type.value) - assert rsp.status_code >= 200 and rsp.status_code < 300 # any 200 response is fine, as a get to the datatypes should not return any error \ No newline at end of file + assert rsp.status_code >= 200 and rsp.status_code < 300 # any 200 response is fine, as a get to the datatypes should not return any error + +# PUT a new dataset, store the id in global variable + +# GET the specific dataset + +# DELETE the specific dataset -- GitLab