@@ -54,7 +54,7 @@ def insert_cp1252_at_end(self, data: list[bytes], new_text: bytes, field: int) -
5454 break
5555 return data
5656
57- def test_process_large_file_with_cp1252 (self ):
57+ def test_process_large_file_cp1252 (self ):
5858 """ Test processing a large file with cp1252 encoding """
5959 n_rows = 500
6060 data = self .create_test_data_from_file ("test-batch-data.csv" )
@@ -79,7 +79,7 @@ def test_process_large_file_with_cp1252(self):
7979 warning_call_args = self .mock_logger_warning .call_args [0 ][0 ]
8080 self .assertEqual (warning_call_args , "Processing Error: Invalid continuation byte." )
8181
82- def test_process_large_file_with_utf8 (self ):
82+ def test_process_large_file_utf8 (self ):
8383 """ Test processing a large file with utf-8 encoding """
8484 n_rows = 500
8585 data = self .create_test_data_from_file ("test-batch-data.csv" )
@@ -101,9 +101,10 @@ def test_process_large_file_with_utf8(self):
101101 self .mock_logger_warning .assert_not_called ()
102102 self .mock_logger_error .assert_not_called ()
103103
104- def test_process_cp1252_small_file (self ):
104+ def test_process_small_file_cp1252 (self ):
105105 """ Test processing a small file with cp1252 encoding """
106106 data = self .create_test_data_from_file ("test-batch-data-cp1252.csv" )
107+ data = self .insert_cp1252_at_end (data , b'D\xe9 cembre' , 2 )
107108 data = [line if line .endswith (b"\n " ) else line + b"\n " for line in data ]
108109 n_rows = len (data ) - 1 # Exclude header
109110
@@ -124,9 +125,9 @@ def test_process_cp1252_small_file(self):
124125 self .assertEqual (self .mock_send_to_kinesis .call_count , n_rows )
125126 self .mock_logger_warning .assert_called ()
126127 warning_call_args = self .mock_logger_warning .call_args [0 ][0 ]
127- self .assertTrue (warning_call_args .startswith ("Invalid Encoding detected in process_csv_to_fhir " ))
128+ self .assertTrue (warning_call_args .startswith ("Invalid Encoding detected" ))
128129
129- def test_process_utf8_small_file (self ):
130+ def test_process_small_file_utf8 (self ):
130131 """ Test processing a small file with utf-8 encoding """
131132 data = self .create_test_data_from_file ("test-batch-data.csv" )
132133 data = [line if line .endswith (b"\n " ) else line + b"\n " for line in data ]
0 commit comments