44from unittest .mock import patch
55from copy import deepcopy
66import boto3
7- from moto import mock_s3 , mock_firehose
8- from tests .utils_for_recordprocessor_tests .utils_for_recordprocessor_tests import (
7+ from moto import mock_s3 , mock_firehose , mock_dynamodb
8+
9+ from tests .utils_for_recordprocessor_tests .generic_setup_and_teardown import (
910 GenericSetUp ,
1011 GenericTearDown ,
1112)
13+ from tests .utils_for_recordprocessor_tests .utils_for_recordprocessor_tests import add_entry_to_table
1214from tests .utils_for_recordprocessor_tests .values_for_recordprocessor_tests import (
1315 MockFileDetails ,
1416 ValidMockFileContent ,
1921with patch ("os.environ" , MOCK_ENVIRONMENT_DICT ):
2022 from batch_processor import process_csv_to_fhir
2123
22-
24+ dynamodb_client = boto3 . client ( "dynamodb" , region_name = REGION_NAME )
2325s3_client = boto3 .client ("s3" , region_name = REGION_NAME )
2426firehose_client = boto3 .client ("firehose" , region_name = REGION_NAME )
2527test_file = MockFileDetails .rsv_emis
2628
2729
28- @patch .dict ("os.environ" , MOCK_ENVIRONMENT_DICT )
2930@mock_s3
3031@mock_firehose
32+ @mock_dynamodb
33+ @patch .dict ("os.environ" , MOCK_ENVIRONMENT_DICT )
3134class TestProcessCsvToFhir (unittest .TestCase ):
3235 """Tests for process_csv_to_fhir function"""
3336
3437 def setUp (self ) -> None :
35- GenericSetUp (s3_client , firehose_client )
38+ GenericSetUp (s3_client = s3_client , firehose_client = firehose_client , dynamodb_client = dynamodb_client )
3639
3740 redis_patcher = patch ("mappings.redis_client" )
3841 self .addCleanup (redis_patcher .stop )
@@ -43,7 +46,7 @@ def setUp(self) -> None:
4346 }])
4447
4548 def tearDown (self ) -> None :
46- GenericTearDown (s3_client , firehose_client )
49+ GenericTearDown (s3_client = s3_client , firehose_client = firehose_client , dynamodb_client = dynamodb_client )
4750
4851 @staticmethod
4952 def upload_source_file (file_key , file_content ):
0 commit comments