Skip to content

Commit a74f89d

Browse files
committed
NPA-4474 Fix Unit Tests
1 parent 767b181 commit a74f89d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

sandbox/api/tests/test_app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
UTILS_FILE_PATH = "sandbox.api.utils"
1414
APP_FILE_PATH = "sandbox.api.app"
15-
15+
CONSENT_FILE_PATH = "sandbox.api.get_consent"
1616

1717
@pytest.mark.parametrize("endpoint", ["/_status", "/_ping", "/health"])
1818
def test_health_check(client: object, endpoint: str) -> None:
@@ -154,7 +154,7 @@ def test_questionnaire_response(
154154
),
155155
],
156156
)
157-
@patch(f"{APP_FILE_PATH}.generate_response_from_example")
157+
@patch(f"{CONSENT_FILE_PATH}.generate_response_from_example")
158158
def test_consent(
159159
mock_generate_response_from_example: MagicMock,
160160
request_args: str,
@@ -176,8 +176,8 @@ def test_consent(
176176
assert response.json == loads(mocked_response.get_data(as_text=True))
177177

178178

179-
@patch(f"{APP_FILE_PATH}.remove_system")
180-
@patch(f"{APP_FILE_PATH}.generate_response_from_example")
179+
@patch(f"{CONSENT_FILE_PATH}.remove_system")
180+
@patch(f"{CONSENT_FILE_PATH}.generate_response_from_example")
181181
def test_consent__500_internal_server_error(
182182
mock_generate_response_from_example: MagicMock,
183183
mock_remove_system: MagicMock,

sandbox/api/tests/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from .conftest import CONSENT_API_ENDPOINT, RELATED_PERSON_API_ENDPOINT
99

1010
FILE_PATH = "sandbox.api.utils"
11-
GET_CONSENT_FILE_PATH = "sandbox.api.get_consent"
1211

1312
@pytest.mark.parametrize(
1413
"request_args,response_file_name,status_code",
@@ -221,7 +220,7 @@ def test_check_for_related_person_errors(
221220
),
222221
],
223222
)
224-
@patch(f"{GET_CONSENT_FILE_PATH}.generate_response_from_example")
223+
@patch(f"{FILE_PATH}.generate_response_from_example")
225224
def test_check_for_consent_errors(
226225
mock_generate_response_from_example: MagicMock,
227226
request_args: str,

0 commit comments

Comments
 (0)