Skip to content

Commit

Permalink
Set return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Jan 9, 2024
1 parent e3e6b51 commit edbf078
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@


class TestApp(unittest.TestCase):
def test_landingpage(self):
def test_landingpage(self) -> None:
response = client.get("/")
self.assertEqual(response.status_code, 200)
self.assertIn("EDR isobaric from Grib", response.text)

def test_conformance(self):
def test_conformance(self) -> None:
response = client.get("/conformance")
self.assertEqual(response.status_code, 200)
self.assertIn(
'{"conformsTo":["http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core",',
response.text,
)

def test_collections(self):
def test_collections(self) -> None:
response = client.get("/collections")
self.assertEqual(response.status_code, 200)
self.assertTrue(response.json()["collections"][0]["id"] == "isobaric")
# '{"links":[{"href":"http://localhost:5000/collections/","hreflang":"en","rel":"self","type":"aplication/json"}],"collections":[{"id":"isobaric","title":"IsobaricGRIB - GRIB files"...

def test_point(self):
def test_point(self) -> None:
response = client.get(f"/collections/isobaric/position?{sample_coords}")
self.assertEqual(response.status_code, 200)
# Test for values in range -> temperature
Expand All @@ -45,7 +45,7 @@ def test_point(self):
len(str(response.json()["domain"]["axes"]["z"]["values"][0])) > 1
)

def test_instances(self):
def test_instances(self) -> None:
"""Test a variety of URLs related to instances."""
# Test list of instances.
response = client.get("/collections/isobaric/instances")
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_instances(self):
response = client.get(
f"/collections/isobaric/instances/1234567890/position?{sample_coords}"
)
self.assertEqual(response.status_code, 400)
self.assertEqual(response.status_code, 422)

# Test asking for a sample point in current instance.
response = client.get(
Expand All @@ -87,7 +87,7 @@ def test_instances(self):
response.text,
)

def test_api(self):
def test_api(self) -> None:
response = client.get("/api")
self.assertEqual(response.status_code, 200)

Expand Down

0 comments on commit edbf078

Please sign in to comment.