File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -781,6 +781,30 @@ def test_cone_search_and_changing_MAIN_GAIA_TABLE(mock_querier_async):
781
781
assert "name_from_class" in job .parameters ["query" ]
782
782
783
783
784
+ def test_datalink_querier_load_data_vot_exception (mock_datalink_querier ):
785
+ file_final = os .path .join (os .getcwd (), 'datalink_output.zip' )
786
+ Path (file_final ).touch ()
787
+
788
+ assert os .path .exists (file_final )
789
+
790
+ with pytest .raises (ValueError ) as excinfo :
791
+ mock_datalink_querier .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
792
+ data_structure = 'INDIVIDUAL' ,
793
+ retrieval_type = "ALL" ,
794
+ linking_parameter = 'SOURCE_ID' , valid_data = False , band = None ,
795
+ avoid_datatype_check = False ,
796
+ format = "votable" , dump_to_file = True , overwrite_output_file = False ,
797
+ verbose = False )
798
+
799
+ assert str (
800
+ excinfo .value ) == (f"{ file_final } file already exists. Please use overwrite_output_file='True' to overwrite "
801
+ f"output file." )
802
+
803
+ os .remove (file_final )
804
+
805
+ assert not os .path .exists (file_final )
806
+
807
+
784
808
def test_datalink_querier_load_data_vot (mock_datalink_querier ):
785
809
result_dict = mock_datalink_querier .load_data (ids = [5937083312263887616 ], data_release = 'Gaia DR3' ,
786
810
data_structure = 'INDIVIDUAL' ,
You can’t perform that action at this time.
0 commit comments