@@ -881,6 +881,7 @@ def test_cone_search_and_changing_MAIN_GAIA_TABLE(mock_querier_async):
881881 assert "name_from_class" in job .parameters ["query" ]
882882
883883
884+ @pytest .mark .filterwarnings ("ignore:" )
884885@pytest .mark .parametrize ("overwrite_output_file" , [True ])
885886def test_datalink_querier_load_data_vot_exception (mock_datalink_querier , overwrite_output_file ):
886887 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
@@ -924,14 +925,16 @@ def test_datalink_querier_load_data_vot_exception(mock_datalink_querier, overwri
924925 assert not os .path .exists (file_final )
925926
926927
928+ @pytest .mark .filterwarnings ("ignore:" )
927929def test_datalink_querier_load_data_vot (mock_datalink_querier ):
928930 result_dict , file_path = mock_datalink_querier .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
929- data_structure = 'DATAMODEL_STANDARD' ,
930- retrieval_type = "ALL" ,
931- linking_parameter = 'SOURCE_ID' , valid_data = False ,
932- avoid_datatype_check = False ,
933- format = "votable" , dump_to_file = True , overwrite_output_file = True ,
934- verbose = False )
931+ data_structure = 'DATAMODEL_STANDARD' ,
932+ retrieval_type = "ALL" ,
933+ linking_parameter = 'SOURCE_ID' , valid_data = False ,
934+ avoid_datatype_check = False ,
935+ format = "votable" , dump_to_file = True ,
936+ overwrite_output_file = True ,
937+ verbose = False )
935938
936939 direc = os .getcwd ()
937940 files = os .listdir (direc )
@@ -940,7 +943,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
940943 Path (direc , f ).is_file () and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
941944
942945 assert len (files ) == 1
943- assert files [0 ] == file_path
946+ assert os . path . join ( direc , files [0 ]) == file_path
944947
945948 datalink_output = files [0 ]
946949
@@ -965,25 +968,32 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
965968
966969 # check the returned output file path
967970
971+
972+ @pytest .mark .filterwarnings ("ignore:" )
973+ def test_datalink_querier_load_data_vot_no_dump_to_file (mock_datalink_querier ):
974+
968975 result_dict , file_path = mock_datalink_querier .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
969- data_structure = 'DATAMODEL_STANDARD' ,
970- retrieval_type = "ALL" ,
971- linking_parameter = 'SOURCE_ID' , valid_data = False ,
972- avoid_datatype_check = False ,
973- format = "votable" , dump_to_file = False , overwrite_output_file = True ,
974- verbose = False )
976+ data_structure = 'DATAMODEL_STANDARD' ,
977+ retrieval_type = "ALL" ,
978+ linking_parameter = 'SOURCE_ID' , valid_data = False ,
979+ avoid_datatype_check = False ,
980+ format = "votable" , dump_to_file = False ,
981+ overwrite_output_file = True ,
982+ verbose = False )
975983
976984 assert file_path is None
977985
978986
987+ @pytest .mark .filterwarnings ("ignore:" )
979988def test_datalink_querier_load_data_ecsv (mock_datalink_querier_ecsv ):
980989 result_dict , file_path = mock_datalink_querier_ecsv .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
981- data_structure = 'DATAMODEL_STANDARD' ,
982- retrieval_type = "ALL" ,
983- linking_parameter = 'SOURCE_ID' , valid_data = False ,
984- avoid_datatype_check = False ,
985- format = "ecsv" , dump_to_file = True , overwrite_output_file = True ,
986- verbose = False )
990+ data_structure = 'DATAMODEL_STANDARD' ,
991+ retrieval_type = "ALL" ,
992+ linking_parameter = 'SOURCE_ID' , valid_data = False ,
993+ avoid_datatype_check = False ,
994+ format = "ecsv" , dump_to_file = True ,
995+ overwrite_output_file = True ,
996+ verbose = False )
987997
988998 direc = os .getcwd ()
989999 files = os .listdir (direc )
@@ -992,7 +1002,7 @@ def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):
9921002 Path (direc , f ).is_file () and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
9931003
9941004 assert len (files ) == 1
995- assert files [0 ] == file_path
1005+ assert os . path . join ( direc , files [0 ]) == file_path
9961006
9971007 datalink_output = files [0 ]
9981008
@@ -1019,14 +1029,16 @@ def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):
10191029 assert not os .path .exists (datalink_output )
10201030
10211031
1032+ @pytest .mark .filterwarnings ("ignore:" )
10221033def test_datalink_querier_load_data_csv (mock_datalink_querier_csv ):
10231034 result_dict , file_path = mock_datalink_querier_csv .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
1024- data_structure = 'DATAMODEL_STANDARD' ,
1025- retrieval_type = "ALL" ,
1026- linking_parameter = 'SOURCE_ID' , valid_data = False ,
1027- avoid_datatype_check = False ,
1028- format = "csv" , dump_to_file = True , overwrite_output_file = True ,
1029- verbose = False )
1035+ data_structure = 'DATAMODEL_STANDARD' ,
1036+ retrieval_type = "ALL" ,
1037+ linking_parameter = 'SOURCE_ID' , valid_data = False ,
1038+ avoid_datatype_check = False ,
1039+ format = "csv" , dump_to_file = True ,
1040+ overwrite_output_file = True ,
1041+ verbose = False )
10301042
10311043 direc = os .getcwd ()
10321044 files = os .listdir (direc )
@@ -1035,7 +1047,7 @@ def test_datalink_querier_load_data_csv(mock_datalink_querier_csv):
10351047 Path (direc , f ).is_file () and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
10361048
10371049 assert len (files ) == 1
1038- assert files [0 ] == file_path
1050+ assert os . path . join ( direc , files [0 ]) == file_path
10391051
10401052 datalink_output = files [0 ]
10411053
@@ -1065,12 +1077,13 @@ def test_datalink_querier_load_data_csv(mock_datalink_querier_csv):
10651077@pytest .mark .filterwarnings ("ignore:" )
10661078def test_datalink_querier_load_data_fits (mock_datalink_querier_fits ):
10671079 result_dict , file_path = mock_datalink_querier_fits .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
1068- data_structure = 'DATAMODEL_STANDARD' ,
1069- retrieval_type = "ALL" ,
1070- linking_parameter = 'SOURCE_ID' , valid_data = False ,
1071- avoid_datatype_check = False ,
1072- format = "fits" , dump_to_file = True , overwrite_output_file = True ,
1073- verbose = False )
1080+ data_structure = 'DATAMODEL_STANDARD' ,
1081+ retrieval_type = "ALL" ,
1082+ linking_parameter = 'SOURCE_ID' , valid_data = False ,
1083+ avoid_datatype_check = False ,
1084+ format = "fits" , dump_to_file = True ,
1085+ overwrite_output_file = True ,
1086+ verbose = False )
10741087
10751088 direc = os .getcwd ()
10761089 files = os .listdir (direc )
@@ -1079,7 +1092,7 @@ def test_datalink_querier_load_data_fits(mock_datalink_querier_fits):
10791092 Path (direc , f ).is_file () and f .endswith (".zip" ) and f .startswith ('datalink_output' )]
10801093
10811094 assert len (files ) == 1
1082- assert files [0 ] == file_path
1095+ assert os . path . join ( direc , files [0 ]) == file_path
10831096
10841097 datalink_output = files [0 ]
10851098
@@ -1106,6 +1119,7 @@ def test_datalink_querier_load_data_fits(mock_datalink_querier_fits):
11061119 assert not os .path .exists (datalink_output )
11071120
11081121
1122+ @pytest .mark .filterwarnings ("ignore:" )
11091123def test_load_data_vot (monkeypatch , tmp_path , tmp_path_factory , patch_datetime_now ):
11101124 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
11111125
@@ -1175,18 +1189,13 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
11751189
11761190 monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
11771191
1178- GAIA_QUERIER .load_data (
1179- valid_data = True ,
1180- ids = "1,2,3,4" ,
1181- format = 'fits' ,
1182- retrieval_type = "epoch_photometry" ,
1183- verbose = True ,
1184- dump_to_file = True ,
1185- overwrite_output_file = True )
1192+ GAIA_QUERIER .load_data (valid_data = True , ids = "1,2,3,4" , format = 'fits' , retrieval_type = "epoch_photometry" ,
1193+ verbose = True , dump_to_file = True , overwrite_output_file = True )
11861194
11871195 path .unlink ()
11881196
11891197
1198+ @pytest .mark .filterwarnings ("ignore:" )
11901199def test_load_data_csv (monkeypatch , tmp_path , tmp_path_factory , patch_datetime_now ):
11911200 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
11921201
@@ -1213,18 +1222,13 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
12131222
12141223 monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
12151224
1216- GAIA_QUERIER .load_data (
1217- valid_data = True ,
1218- ids = "1,2,3,4" ,
1219- format = 'csv' ,
1220- retrieval_type = "epoch_photometry" ,
1221- verbose = True ,
1222- dump_to_file = True ,
1223- overwrite_output_file = True )
1225+ GAIA_QUERIER .load_data (valid_data = True , ids = "1,2,3,4" , format = 'csv' , retrieval_type = "epoch_photometry" ,
1226+ verbose = True , dump_to_file = True , overwrite_output_file = True )
12241227
12251228 path .unlink ()
12261229
12271230
1231+ @pytest .mark .filterwarnings ("ignore:" )
12281232def test_load_data_ecsv (monkeypatch , tmp_path , tmp_path_factory , patch_datetime_now ):
12291233 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
12301234
@@ -1251,18 +1255,13 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
12511255
12521256 monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
12531257
1254- GAIA_QUERIER .load_data (
1255- valid_data = True ,
1256- ids = "1,2,3,4" ,
1257- format = 'ecsv' ,
1258- retrieval_type = "epoch_photometry" ,
1259- verbose = True ,
1260- dump_to_file = True ,
1261- overwrite_output_file = True )
1258+ GAIA_QUERIER .load_data (valid_data = True , ids = "1,2,3,4" , format = 'ecsv' , retrieval_type = "epoch_photometry" ,
1259+ verbose = True , dump_to_file = True , overwrite_output_file = True )
12621260
12631261 path .unlink ()
12641262
12651263
1264+ @pytest .mark .filterwarnings ("ignore:" )
12661265def test_load_data_linking_parameter (monkeypatch , tmp_path , patch_datetime_now ):
12671266 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
12681267
@@ -1289,18 +1288,13 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
12891288
12901289 monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
12911290
1292- GAIA_QUERIER .load_data (
1293- ids = "1,2,3,4" ,
1294- retrieval_type = "epoch_photometry" ,
1295- linking_parameter = "SOURCE_ID" ,
1296- valid_data = True ,
1297- verbose = True ,
1298- dump_to_file = True ,
1299- overwrite_output_file = True )
1291+ GAIA_QUERIER .load_data (ids = "1,2,3,4" , retrieval_type = "epoch_photometry" , linking_parameter = "SOURCE_ID" ,
1292+ valid_data = True , verbose = True , dump_to_file = True , overwrite_output_file = True )
13001293
13011294 path .unlink ()
13021295
13031296
1297+ @pytest .mark .filterwarnings ("ignore:" )
13041298@pytest .mark .parametrize ("linking_param" , ['TRANSIT_ID' , 'IMAGE_ID' ])
13051299def test_load_data_linking_parameter_with_values (monkeypatch , tmp_path , linking_param , patch_datetime_now ):
13061300 assert datetime .datetime .now (datetime .timezone .utc ) == FAKE_TIME
@@ -1338,14 +1332,8 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
13381332
13391333 monkeypatch .setattr (TapPlus , "load_data" , load_data_monkeypatched )
13401334
1341- GAIA_QUERIER .load_data (
1342- ids = "1,2,3,4" ,
1343- retrieval_type = "epoch_photometry" ,
1344- linking_parameter = linking_param ,
1345- valid_data = True ,
1346- verbose = True ,
1347- dump_to_file = True ,
1348- overwrite_output_file = True )
1335+ GAIA_QUERIER .load_data (ids = "1,2,3,4" , retrieval_type = "epoch_photometry" , linking_parameter = linking_param ,
1336+ valid_data = True , verbose = True , dump_to_file = True , overwrite_output_file = True )
13491337
13501338 path .unlink ()
13511339
0 commit comments