Skip to content

Commit

Permalink
Tidied API test code
Browse files Browse the repository at this point in the history
  • Loading branch information
rwb27 committed Jul 24, 2021
1 parent 23c720a commit bbb08b8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,13 @@ def dict_is_openapi(d):
return True


def test_openapi_json_endpoint(thing):
c = thing.app.test_client()
r = c.get("/docs/openapi")
def test_openapi_json_endpoint(thing, client):
r = client.get("/docs/openapi")
assert r.status_code == 200
assert dict_is_openapi(r.get_json())


def test_openapi_yaml_endpoint(thing):
c = thing.app.test_client()

r = c.get("/docs/openapi.yaml")
def test_openapi_yaml_endpoint(thing, client):
r = client.get("/docs/openapi.yaml")
assert r.status_code == 200
assert dict_is_openapi(yaml.safe_load(r.data))

0 comments on commit bbb08b8

Please sign in to comment.