Skip to content
Snippets Groups Projects
Commit eff72a69 authored by Jedrzej Rybicki's avatar Jedrzej Rybicki
Browse files

test using testcase

parent 2952a420
Branches
Tags
No related merge requests found
...@@ -5,19 +5,22 @@ from fastapi.testclient import TestClient ...@@ -5,19 +5,22 @@ from fastapi.testclient import TestClient
from context import apiserver from context import apiserver
from context import storage from context import storage
import unittest
client = TestClient(apiserver.app)
# get root class SomeTests(unittest.TestCase):
def test_root(): def setUp(self):
rsp = client.get('/') self.client = TestClient(apiserver.app)
assert rsp.status_code >= 200 and rsp.status_code < 300 # any 200 response is fine, as a get to the root should not return any error
# get every type in type enum
def test_types(): def test_root(self):
for location_type in storage.LocationDataType: rsp = self.client.get('/')
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 root should not return any error
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
def test_types(self):
for location_type in storage.LocationDataType:
rsp = self.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
# PUT a new dataset, store the id in global variable # PUT a new dataset, store the id in global variable
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment