File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11import base64
22import unittest
33import datetime
4- from unittest .mock import create_autospec
4+ from unittest .mock import create_autospec , patch
55
66from authorization import Authorization
77from fhir_service import FhirService
1414 create_query_string ,
1515 SearchParams ,
1616)
17+ from sample_data .mock_redis_cache import fake_hget
1718
18- "test"
1919class TestParameterParser (unittest .TestCase ):
2020 def setUp (self ):
2121 self .service = create_autospec (FhirService )
@@ -24,6 +24,14 @@ def setUp(self):
2424 self .immunization_target_key = "-immunization.target"
2525 self .date_from_key = "-date.from"
2626 self .date_to_key = "-date.to"
27+ self .logger_info_patcher = patch ("logging.Logger.info" )
28+ self .mock_logger_info = self .logger_info_patcher .start ()
29+ self .redis_patcher = patch ("parameter_parser.redis_client" )
30+ self .mock_redis_client = self .redis_patcher .start ()
31+ self .mock_redis_client .hget .side_effect = fake_hget
32+
33+ def tearDown (self ):
34+ patch .stopall ()
2735
2836 def test_process_params_combines_content_and_query_string (self ):
2937 lambda_event = {
Original file line number Diff line number Diff line change 1111class TestUpdateImmunizations (unittest .TestCase ):
1212 def setUp (self ):
1313 self .controller = create_autospec (FhirController )
14- # self.controller.update_immunization = FhirController.update_immunization
1514 self .logger_exception_patcher = patch ("logging.Logger.exception" )
1615 self .mock_logger_exception = self .logger_exception_patcher .start ()
1716 self .logger_info_patcher = patch ("logging.Logger.info" )
1817 self .mock_logger_info = self .logger_info_patcher .start ()
19-
20-
21-
22-
2318
2419 def tearDown (self ):
2520 self .logger_exception_patcher .stop ()
You can’t perform that action at this time.
0 commit comments