Skip to content

Commit 94b8099

Browse files
Jorge Fernandez HernandezJorge Fernandez Hernandez
authored andcommitted
GAIAMNGT-1700 Remove test
1 parent 72617e6 commit 94b8099

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

astroquery/gaia/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retr
242242
log.info(f"DataLink products will be stored in the {output_file} file")
243243

244244
if not overwrite_output_file and os.path.exists(output_file):
245-
log.warn(f"{output_file} file already exists and will be overwritten")
245+
raise ValueError(f"{output_file} file already exists. Please use overwrite_output_file='True' to "
246+
f"overwrite output file.")
246247

247248
path = os.path.dirname(output_file)
248249

astroquery/gaia/tests/test_gaiatap.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -781,24 +781,6 @@ def test_cone_search_and_changing_MAIN_GAIA_TABLE(mock_querier_async):
781781
assert "name_from_class" in job.parameters["query"]
782782

783783

784-
def test_datalink_querier_load_data_no_dump_vot(mock_datalink_querier):
785-
result_dict = mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
786-
data_structure='INDIVIDUAL',
787-
retrieval_type="ALL",
788-
linking_parameter='SOURCE_ID', valid_data=False, band=None,
789-
avoid_datatype_check=False,
790-
format="votable", dump_to_file=False, overwrite_output_file=True,
791-
verbose=False)
792-
793-
assert len(result_dict) == 3
794-
795-
files = list(result_dict.keys())
796-
files.sort()
797-
assert files[0] == 'MCMC_MSC-Gaia DR3 5937083312263887616.xml'
798-
assert files[1] == 'XP_CONTINUOUS-Gaia DR3 5937083312263887616.xml'
799-
assert files[2] == 'XP_SAMPLED-Gaia DR3 5937083312263887616.xml'
800-
801-
802784
def test_datalink_querier_load_data_vot(mock_datalink_querier):
803785
result_dict = mock_datalink_querier.load_data(ids=[5937083312263887616], data_release='Gaia DR3',
804786
data_structure='INDIVIDUAL',
@@ -808,7 +790,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
808790
format="votable", dump_to_file=True, overwrite_output_file=True,
809791
verbose=False)
810792

811-
assert os.path.exists('datalink_output.zip')
793+
assert os.path.exists(os.path.join(os.getcwd(), 'datalink_output.zip'))
812794

813795
extracted_files = []
814796

@@ -827,7 +809,7 @@ def test_datalink_querier_load_data_vot(mock_datalink_querier):
827809

828810
os.remove(os.path.join(os.getcwd(), 'datalink_output.zip'))
829811

830-
assert not os.path.exists('datalink_output.zip')
812+
assert not os.path.exists(os.path.join(os.getcwd(), 'datalink_output.zip'))
831813

832814

833815
def test_datalink_querier_load_data_ecsv(mock_datalink_querier_ecsv):

0 commit comments

Comments
 (0)