Skip to content
Snippets Groups Projects
Commit 092b1d8d authored by Erik Reid's avatar Erik Reid
Browse files

added test of testing routes

more for maintaining coverage than actually necessary ;)
parent c1f12d26
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,10 @@ class MockedRedis(object):
k.encode("utf-8") for k in MockedRedis.db.keys()
if k.startswith(m.group(1))])
def flushdb(self):
# only called from testing routes (hopefully)
pass
@pytest.fixture
def data_config():
......@@ -149,6 +153,7 @@ def client(app_config, mocker):
MockedRedis)
os.environ["SETTINGS_FILENAME"] = app_config
os.environ["ENABLE_TESTING_ROUTES"] = "1"
with inventory_provider.create_app().test_client() as c:
yield c
......
import json
import jsonschema
DEFAULT_REQUEST_HEADERS = {
"Content-type": "application/json",
"Accept": ["application/json"]
}
def test_flushdb(client):
rv = client.post(
"/testing/flushdb",
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment