463463 Lumen ,
464464 [
465465 ("html" , Path (dir_path , "data" , "lumen" , "lumen8.html" )),
466- # (EMAIL_HEADER_DATE, Path(dir_path, "data", "date", "email_date_1")),
466+ (EMAIL_HEADER_DATE , Path (dir_path , "data" , "date" , "email_date_1" )),
467467 (EMAIL_HEADER_SUBJECT , Path (dir_path , "data" , "lumen" , "subject_work_planned" )),
468468 ],
469469 [
470470 Path (dir_path , "data" , "lumen" , "lumen8_result.json" ),
471- # Path(dir_path, "data", "date", "email_date_1_result.json"),
472471 ],
473472 ),
474473 # Megaport
823822)
824823def test_provider_get_maintenances (
825824 provider_class , test_data_files , result_parse_files
826- ): # pylint: disable=too-many-locals
825+ ): # pylint: disable=too-many-locals,too-many-branches
827826 """End to End tests for various Providers."""
828827 extended_data = provider_class .get_extended_data ()
829828 default_maintenance_data = {"uid" : "0" , "sequence" : 1 , "summary" : "" }
@@ -849,10 +848,18 @@ def test_provider_get_maintenances(
849848 for result_parse_file in result_parse_files :
850849 with open (result_parse_file , encoding = "utf-8" ) as res_file :
851850 partial_result_data = json .load (res_file )
852- if not expected_result :
851+
852+ # TODO: Tests assume that maintenances (multiple) will be discovered on the first parser
853+ if not expected_result and isinstance (partial_result_data , list ):
853854 expected_result = partial_result_data
855+
856+ if expected_result and isinstance (partial_result_data , dict ):
857+ for _ in range (len (expected_result )):
858+ expected_result [0 ].update (partial_result_data )
854859 else :
855- expected_result [0 ].update (partial_result_data [0 ])
860+ assert len (expected_result ) == len (expected_result )
861+ for i , _ in enumerate (partial_result_data ):
862+ expected_result [i ].update (partial_result_data [i ])
856863
857864 for result in expected_result :
858865 temp_res = result .copy ()
0 commit comments