@@ -131,6 +131,36 @@ def test_validate_with_invalid_file(self):
131131 self .assertFalse (result .is_valid )
132132 self .assertIsInstance (result .validation_message , list )
133133
134+ def test_validate_with_invalid_file_with_default_error_counts (self ):
135+ # Arrange
136+ file_path = f'{ SAVED_FILE_PATH } /{ FAILURE_FILE_NAME } '
137+ expected_downloaded_file_path = file_path
138+ self .validator .download_single_file = MagicMock (return_value = expected_downloaded_file_path )
139+ Validation .clean_up = MagicMock ()
140+
141+ # Act
142+ result = self .validator .validate ()
143+
144+ # Assert
145+ self .assertFalse (result .is_valid )
146+ self .assertIsInstance (result .validation_message , list )
147+ self .assertLessEqual (len (result .validation_message ), 20 )
148+
149+ def test_validate_with_invalid_file_with_specific_error_counts (self ):
150+ # Arrange
151+ file_path = f'{ SAVED_FILE_PATH } /{ FAILURE_FILE_NAME } '
152+ expected_downloaded_file_path = file_path
153+ self .validator .download_single_file = MagicMock (return_value = expected_downloaded_file_path )
154+ Validation .clean_up = MagicMock ()
155+
156+ # Act
157+ result = self .validator .validate (max_errors = 10 )
158+
159+ # Assert
160+ self .assertFalse (result .is_valid )
161+ self .assertIsInstance (result .validation_message , list )
162+ self .assertLessEqual (len (result .validation_message ), 10 )
163+
134164 def test_is_osw_valid_with_invalid_zip_file (self ):
135165 # Arrange
136166 file_path = f'{ SAVED_FILE_PATH } /{ FAILURE_FILE_NAME } '
@@ -184,7 +214,7 @@ def test_is_osw_valid_with_id_missing_zip(self):
184214 Validation .clean_up = MagicMock ()
185215
186216 # Act
187- result = self .validator .is_osw_valid ()
217+ result = self .validator .is_osw_valid (max_errors = 2 )
188218
189219 # Assert
190220 self .assertFalse (result .is_valid )
@@ -214,7 +244,7 @@ def test_is_osw_valid_with_invalid_edges_zip(self):
214244 Validation .clean_up = MagicMock ()
215245
216246 # Act
217- result = self .validator .is_osw_valid ()
247+ result = self .validator .is_osw_valid (max_errors = 2 )
218248
219249 # Assert
220250 self .assertFalse (result .is_valid )
@@ -244,7 +274,7 @@ def test_is_osw_valid_with_invalid_nodes_zip(self):
244274 Validation .clean_up = MagicMock ()
245275
246276 # Act
247- result = self .validator .is_osw_valid ()
277+ result = self .validator .is_osw_valid (max_errors = 2 )
248278
249279 # Assert
250280 self .assertFalse (result .is_valid )
@@ -274,7 +304,7 @@ def test_is_osw_valid_with_invalid_points_zip(self):
274304 Validation .clean_up = MagicMock ()
275305
276306 # Act
277- result = self .validator .is_osw_valid ()
307+ result = self .validator .is_osw_valid (max_errors = 2 )
278308
279309 # Assert
280310 self .assertFalse (result .is_valid )
@@ -304,7 +334,7 @@ def test_is_osw_valid_with_invalid_files_zip(self):
304334 Validation .clean_up = MagicMock ()
305335
306336 # Act
307- result = self .validator .is_osw_valid ()
337+ result = self .validator .is_osw_valid (max_errors = 2 )
308338
309339 # Assert
310340 self .assertFalse (result .is_valid )
@@ -334,7 +364,7 @@ def test_is_osw_valid_with_invalid_geometry_zip(self):
334364 Validation .clean_up = MagicMock ()
335365
336366 # Act
337- result = self .validator .is_osw_valid ()
367+ result = self .validator .is_osw_valid (max_errors = 2 )
338368
339369 # Assert
340370 self .assertFalse (result .is_valid )
@@ -364,7 +394,7 @@ def test_is_osw_valid_with_missing_identifier_zip(self):
364394 Validation .clean_up = MagicMock ()
365395
366396 # Act
367- result = self .validator .is_osw_valid ()
397+ result = self .validator .is_osw_valid (max_errors = 2 )
368398
369399 # Assert
370400 self .assertFalse (result .is_valid )
@@ -394,7 +424,7 @@ def test_is_osw_valid_with_no_entity_zip(self):
394424 Validation .clean_up = MagicMock ()
395425
396426 # Act
397- result = self .validator .is_osw_valid ()
427+ result = self .validator .is_osw_valid (max_errors = 2 )
398428
399429 # Assert
400430 self .assertFalse (result .is_valid )
@@ -424,7 +454,7 @@ def test_is_osw_valid_with_wring_datatype_zip(self):
424454 Validation .clean_up = MagicMock ()
425455
426456 # Act
427- result = self .validator .is_osw_valid ()
457+ result = self .validator .is_osw_valid (max_errors = 2 )
428458
429459 # Assert
430460 self .assertFalse (result .is_valid )
0 commit comments