diff --git a/nest_backend/test/test_0_doa.py b/nest_backend/test/test_0_doa.py index 46534f1..714e263 100644 --- a/nest_backend/test/test_0_doa.py +++ b/nest_backend/test/test_0_doa.py @@ -6,3 +6,8 @@ from flask.testing import Client def test_doa(flask_client: Client, admin_headers): response = flask_client.get("/doa", headers=admin_headers) assert b"If you see this, the server is fine." in response.data + + +def test_sq_told_me_to_do_this(flask_client: Client, user_headers): + response = flask_client.post("/doa", headers=user_headers) + assert b"Hello there." in response.data diff --git a/nest_backend/test/test_1_user.py b/nest_backend/test/test_1_user.py index 38cf6b2..3cc30c3 100644 --- a/nest_backend/test/test_1_user.py +++ b/nest_backend/test/test_1_user.py @@ -24,7 +24,7 @@ class TestUserGetAll: assert r.json["result"] == "success" def test_for_failure(self, flask_client: Client, user_headers): - r = flask_client.get(f'/api/v1/users/', headers=user_headers) + r = flask_client.patch(f'/api/v1/users/', headers=user_headers) assert r.json["result"] == "failure" diff --git a/nest_backend/test/test_2_repository.py b/nest_backend/test/test_2_repository.py index 910c6ae..9c393b7 100644 --- a/nest_backend/test/test_2_repository.py +++ b/nest_backend/test/test_2_repository.py @@ -213,8 +213,8 @@ class TestRepositoryPut: assert r.status_code == 404 assert r.json["result"] == "failure" - def test_for_success(self, flask_client: Client, admin_headers): - r = flask_client.put(f'/api/v1/repositories/1', headers=admin_headers, json={ + def test_for_success(self, flask_client: Client, user_headers): + r = flask_client.put(f'/api/v1/repositories/1', headers=user_headers, json={ "conditions": [ { "content": "string", diff --git a/nest_backend/test/test_3_condition.py b/nest_backend/test/test_3_condition.py index fb621e1..e7dc5b7 100644 --- a/nest_backend/test/test_3_condition.py +++ b/nest_backend/test/test_3_condition.py @@ -12,8 +12,8 @@ class TestConditionGetAllOfARepository: assert r.status_code == 404 assert r.json["result"] == "failure" - def test__unauthorized_repository(self, flask_client: Client, admin_headers): - r = flask_client.get(f'/api/v1/repositories/1/conditions/', headers=admin_headers) + def test__unauthorized_user(self, flask_client: Client, user_headers): + r = flask_client.get(f'/api/v1/repositories/2/conditions/', headers=user_headers) assert r.status_code == 403 assert r.json["result"] == "failure" diff --git a/nest_backend/test/test_5_authorizations.py b/nest_backend/test/test_5_authorizations.py index b91ca7f..102ddca 100644 --- a/nest_backend/test/test_5_authorizations.py +++ b/nest_backend/test/test_5_authorizations.py @@ -74,9 +74,8 @@ class TestAuthorizationsPut: class TestAuthorizationsDelete: def test_for_success(self, flask_client: Client, user_headers): - r = flask_client.delete(f'/api/v1/repositories/1/authorizations/user_test@nest.com', headers=user_headers) + r = flask_client.delete(f'/api/v1/repositories/1/authorizations/admin@admin.com', headers=user_headers) assert r.status_code == 204 - assert r.json["result"] == "success" def test_user_not_logged(self, flask_client: Client): r = flask_client.delete(f'/api/v1/repositories/1/authorizations/user_test@nest.com')