Skip to content

Commit 4e2645f

Browse files
committed
unit test
1 parent ae0876d commit 4e2645f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

recordprocessor/tests/test_recordprocessor_edge_cases.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
import os
33
from io import BytesIO
4-
from unittest.mock import patch
4+
from unittest.mock import call, patch
55
from batch_processor import process_csv_to_fhir
66
from tests.utils_for_recordprocessor_tests.utils_for_recordprocessor_tests import create_patch
77

@@ -69,6 +69,7 @@ def test_process_large_file_cp1252(self):
6969
message_body = {
7070
"vaccine_type": "vax-type-1",
7171
"supplier": "test-supplier",
72+
"filename": "test-filename"
7273
}
7374
self.mock_map_target_disease.return_value = "some disease"
7475

@@ -79,6 +80,10 @@ def test_process_large_file_cp1252(self):
7980
self.mock_logger_warning.assert_called()
8081
warning_call_args = self.mock_logger_warning.call_args[0][0]
8182
self.assertTrue(warning_call_args.startswith("Encoding Error: 'utf-8' codec can't decode byte 0xe9"))
83+
self.mock_s3_get_object.assert_has_calls([
84+
call(Bucket=None, Key="test-filename"),
85+
call(Bucket=None, Key="processing/test-filename"),
86+
])
8287

8388
def test_process_large_file_utf8(self):
8489
""" Test processing a large file with utf-8 encoding """

0 commit comments

Comments
 (0)