diff --git a/consumer_api/tests/consumers_view_test.py b/consumer_api/tests/consumers_view_test.py index f713074..2a65149 100644 --- a/consumer_api/tests/consumers_view_test.py +++ b/consumer_api/tests/consumers_view_test.py @@ -4,26 +4,7 @@ from flask import current_app @pytest.fixture -def client(): - current_app.config["TESTING"] = True +def test_response_length(client): + r = client.get('/log') - with current_app.test_client() as client: - yield client - - -def test_access_denied(client): - r = client.get('/api/user') - - assert r.status_code == 401 - - -def test_access_denied2(client): - r = client.get('/api/user', headers = { "Authorization": "invalidkey" }) - - assert r.status_code == 401 - - -def test_empty_database(client): - r = client.get('/api/user', headers = { "Authorization": "testkey" }) - - assert len(r.json) == 0 + assert len(r) == 0 diff --git a/consumer_api/tests/log_view_test.py b/consumer_api/tests/log_view_test.py new file mode 100644 index 0000000..934b210 --- /dev/null +++ b/consumer_api/tests/log_view_test.py @@ -0,0 +1,13 @@ +import pytest + +from flask import current_app + + +@pytest.fixture + +def test_log_code(client): + r = client.get('/log') + + assert r.status_code == 204 + +