Skip to content

Commit 698a7ca

Browse files
committed
14 errors
1 parent f544028 commit 698a7ca

File tree

12 files changed

+27
-22
lines changed

12 files changed

+27
-22
lines changed

ack_backend/tests/test_splunk_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from tests.utils_for_ack_backend_tests.utils_for_ack_backend_tests import generate_event
2020

2121
with patch.dict("os.environ", MOCK_ENVIRONMENT_DICT):
22-
from src.ack_processor import lambda_handler
22+
from ack_processor import lambda_handler
2323

2424
s3_client = boto3_client("s3")
2525

backend/tests/test_fhir_repository.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def tearDown(self):
4242
super().tearDown()
4343

4444

45-
class TestGetImmunizationByIdentifier(TestFhirRepository):
45+
class TestGetImmunizationByIdentifier(TestFhirRepositoryBase):
4646
def setUp(self):
4747
super().setUp()
4848
self.table = MagicMock()
@@ -170,12 +170,17 @@ def _make_a_patient(nhs_number="1234567890") -> dict:
170170
}
171171

172172

173-
class TestCreateImmunizationMainIndex(unittest.TestCase):
173+
class TestCreateImmunizationMainIndex(TestFhirRepositoryBase):
174174
def setUp(self):
175+
super().setUp()
175176
self.table = MagicMock()
176177
self.repository = ImmunizationRepository(table=self.table)
177178
self.patient = {"id": "a-patient-id", "identifier": {"value": "an-identifier"}}
178179

180+
def tearDown(self):
181+
patch.stopall()
182+
super().tearDown()
183+
179184
def test_create_immunization(self):
180185
"""it should create Immunization, and return created object"""
181186
imms = create_covid_19_immunization_dict(imms_id="an-id")
@@ -355,7 +360,7 @@ def test_create_patient_with_unauthorised_vaccine_type_permissions(self):
355360
self.repository.create_immunization(imms, self.patient, "COVID:create", "Test")
356361

357362

358-
class TestUpdateImmunization(TestFhirRepository):
363+
class TestUpdateImmunization(TestFhirRepositoryBase):
359364
def setUp(self):
360365
super().setUp()
361366
self.table = MagicMock()
@@ -678,7 +683,7 @@ def test_bad_response_from_dynamo(self):
678683
self.assertDictEqual(e.exception.response, response)
679684

680685

681-
class TestImmunizationDecimals(TestFhirRepository):
686+
class TestImmunizationDecimals(TestFhirRepositoryBase):
682687
"""It should create a record and keep decimal precision"""
683688

684689
def setUp(self):

backend/tests/test_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import unittest
77

8-
from src.constants import Urls
9-
from src.filter import (
8+
from constants import Urls
9+
from filter import (
1010
Filter,
1111
remove_reference_to_contained_practitioner,
1212
create_reference_to_patient_resource,

backend/tests/test_immunization_post_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sample_data.mock_redis_cache import fake_hget
1010

1111

12-
from src.models.fhir_immunization import ImmunizationValidator
12+
from models.fhir_immunization import ImmunizationValidator
1313
from tests.utils.generic_utils import (
1414
# these have an underscore to avoid pytest collecting them as tests
1515
test_invalid_values_rejected as _test_invalid_values_rejected,

backend/tests/test_immunization_pre_validator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
from jsonpath_ng.ext import parse
1111

12-
from src.clients import redis_client
13-
from src.models.fhir_immunization import ImmunizationValidator
14-
from src.models.utils.generic_utils import get_generic_extension_value
12+
from clients import redis_client
13+
from models.fhir_immunization import ImmunizationValidator
14+
from models.utils.generic_utils import get_generic_extension_value
1515
from .utils.generic_utils import (
1616
# these have an underscore to avoid pytest collecting them as tests
1717
test_valid_values_accepted as _test_valid_values_accepted,
1818
test_invalid_values_rejected as _test_invalid_values_rejected,
1919
load_json_data,
2020
)
21-
from src.models.utils.generic_utils import (
21+
from models.utils.generic_utils import (
2222
patient_name_given_field_location,
2323
patient_name_family_field_location,
2424
practitioner_name_given_field_location,

backend/tests/test_log_structure_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import unittest
22
import json
33
from unittest.mock import patch, MagicMock, ANY
4-
from src.log_structure import function_info
4+
from log_structure import function_info
55

66

7-
@patch('src.log_structure.firehose_logger')
8-
@patch('src.log_structure.logger')
7+
@patch('log_structure.firehose_logger')
8+
@patch('log_structure.logger')
99
class TestFunctionInfoWrapper(unittest.TestCase):
1010

1111
@staticmethod

delta_backend/tests/test_current_period.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from datetime import datetime, timezone
3-
from src.extractor import Extractor
3+
from extractor import Extractor
44

55

66
class TestIsCurrentPeriod(unittest.TestCase):

mesh_processor/tests/test_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from unittest import TestCase
22
from unittest.mock import patch, MagicMock
3-
from src.converter import lambda_handler, ensure_dat_extension
3+
from converter import lambda_handler, ensure_dat_extension
44

55

66
class TestLambdaHandler(TestCase):

recordprocessor/tests/test_make_and_upload_ack_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from tests.utils_for_recordprocessor_tests.values_for_recordprocessor_tests import MockFileDetails
1111

1212
with patch("os.environ", MOCK_ENVIRONMENT_DICT):
13-
from src.make_and_upload_ack_file import make_ack_data, upload_ack_file, make_and_upload_ack_file
13+
from make_and_upload_ack_file import make_ack_data, upload_ack_file, make_and_upload_ack_file
1414
from clients import REGION_NAME
1515

1616
from tests.utils_for_recordprocessor_tests.utils_for_recordprocessor_tests import GenericSetUp, GenericTearDown

recordprocessor/tests/test_process_row.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
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 src.mappings import Vaccine' as this imports a different instance of Vaccine
23+
# Do not attempt 'from mappings import Vaccine' as this imports a different instance of Vaccine
2424
# and tests will break
2525
from clients import REGION_NAME
26-
from src.process_row import process_row
26+
from process_row import process_row
2727

2828
s3_client = boto3_client("s3", region_name=REGION_NAME)
2929
ROW_DETAILS = MockFieldDictionaries.all_fields

0 commit comments

Comments
 (0)