Skip to content

Commit 36278b3

Browse files
committed
tidy
1 parent e48863d commit 36278b3

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

backend/tests/test_forwarding_batch_lambda.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import copy
1818
import json
1919

20-
from tests.utils.test_utils_for_batch import ForwarderValues, MockFhirImmsResources
21-
20+
from utils.test_utils_for_batch import ForwarderValues, MockFhirImmsResources
21+
from utils.mock_redis import MOCK_REDIS_D2V_RESPONSE
2222

2323
with patch.dict("os.environ", ForwarderValues.MOCK_ENVIRONMENT_DICT):
2424
from forwarding_batch_lambda import forward_lambda_handler, create_diagnostics_dictionary, forward_request_to_dynamo
@@ -28,21 +28,6 @@
2828
@patch.dict(os.environ, ForwarderValues.MOCK_ENVIRONMENT_DICT)
2929
class TestForwardLambdaHandler(TestCase):
3030

31-
MOCK_REDIS_D2V_RESPONSE = json.dumps({
32-
"4740000": "SHINGLES",
33-
"6142004": "FLU",
34-
"16814004": "PCV13",
35-
"23511006": "MENACWY",
36-
"27836007": "PERTUSSIS",
37-
"55735004": "RSV",
38-
"240532009": "HPV",
39-
"840539006": "COVID19",
40-
"14189004:36653000:36989005": "MMR",
41-
"14189004:36653000:36989005:38907003": "MMRV",
42-
"397430003:398102009:76902006": "3in1"
43-
})
44-
45-
4631
def setUp(self):
4732
"""Set up dynamodb table test values to be used for the tests"""
4833
self.dynamodb_resource = boto3_resource("dynamodb", "eu-west-2")
@@ -76,7 +61,7 @@ def setUp(self):
7661
)
7762
self.redis_patcher = patch("models.utils.validation_utils.redis_client")
7863
self.mock_redis_client = self.redis_patcher.start()
79-
self.mock_redis_client.hget.return_value = self.MOCK_REDIS_D2V_RESPONSE
64+
self.mock_redis_client.hget.return_value = MOCK_REDIS_D2V_RESPONSE
8065

8166
def tearDown(self):
8267
"""Tear down after each test. This runs after every test"""
@@ -203,7 +188,7 @@ def test_forward_lambda_handler_single_operations(self, mock_send_message):
203188
"PatientSK": "RSV#4d2ac1eb-080f-4e54-9598-f2d53334681c",
204189
}
205190
)
206-
self.mock_redis_client.hget.return_value = self.MOCK_REDIS_D2V_RESPONSE
191+
self.mock_redis_client.hget.return_value = MOCK_REDIS_D2V_RESPONSE
207192

208193
test_cases = [
209194
{

backend/tests/utils/mock_redis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
MOCK_REDIS_D2V_RESPONSE = {
1+
import json
2+
3+
MOCK_REDIS_D2V_RESPONSE = json.dumps({
24
"4740000": "SHINGLES",
35
"6142004": "FLU",
46
"16814004": "PCV13",
@@ -10,7 +12,7 @@
1012
"14189004:36653000:36989005": "MMR",
1113
"14189004:36653000:36989005:38907003": "MMRV",
1214
"397430003:398102009:76902006": "3in1"
13-
}
15+
})
1416

1517
MOCK_REDIS_V2D_RESPONSE = {
1618
"PERTUSSIS": "[{\"code\": \"27836007\", \"term\": \"Pertussis (disorder)\"}]",

recordprocessor/tests/test_process_row.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
from tests.utils_for_recordprocessor_tests.mock_environment_variables import MOCK_ENVIRONMENT_DICT
2121

2222
with patch("os.environ", MOCK_ENVIRONMENT_DICT):
23-
# Do not attempt 'from mappings import Vaccine' as this imports a different instance of Vaccine
24-
# and tests will break
2523
from clients import REGION_NAME
2624
from process_row import process_row
2725

0 commit comments

Comments
 (0)