1111
1212from .. import Alma
1313
14- all_colnames = [ 'Project code' , 'Source name' , 'RA' , 'Dec' , 'Band' ,
14+ all_colnames = { 'Project code' , 'Source name' , 'RA' , 'Dec' , 'Band' ,
1515 'Frequency resolution' , 'Integration' , 'Release date' ,
1616 'Frequency support' , 'Velocity resolution' , 'Pol products' ,
1717 'Observation date' , 'PI name' , 'PWV' , 'Member ous id' ,
1818 'Asdm uid' , 'Project title' , 'Project type' , 'Scan intent' ,
19- 'Spatial resolution' , 'Largest angular scale' , 'QA0 Status' ,
20- 'QA2 Status' , 'Project abstract' ]
19+ 'Spatial resolution' , 'Largest angular scale' ,
20+ 'QA2 Status' , 'Group ous id' , 'Pub' }
2121
2222
2323@remote_data
@@ -59,7 +59,7 @@ def test_SgrAstar(self, temp_dir):
5959 result_c = alma .query_region (c , 1 * u .deg )
6060 assert b'2011.0.00217.S' in result_c ['Project code' ]
6161
62- def test_m83 (self , temp_dir ):
62+ def test_m83 (self , temp_dir , recwarn ):
6363 alma = Alma ()
6464 alma .cache_location = temp_dir
6565
@@ -72,14 +72,21 @@ def test_m83(self, temp_dir):
7272 assert len (link_list ) >= 47
7373
7474 # test re-staging
75- with pytest .raises (requests .HTTPError ) as ex :
76- link_list = alma .stage_data (uids )
77- assert ex .value .args [0 ] == ('Received an error 405: this may indicate you have '
78- 'already staged the data. Try downloading the '
79- 'file URLs directly with download_files.' )
80-
81-
82- def test_stage_data (self , temp_dir ):
75+ # (has been replaced with warning)
76+ #with pytest.raises(requests.HTTPError) as ex:
77+ # link_list = alma.stage_data(uids)
78+ #assert ex.value.args[0] == ('Received an error 405: this may indicate you have '
79+ # 'already staged the data. Try downloading the '
80+ # 'file URLs directly with download_files.')
81+
82+ # log.warning doesn't actually make a warning
83+ #link_list = alma.stage_data(uids)
84+ #w = recwarn.pop()
85+ #assert (str(w.message) == ('Error 405 received. If you have previously staged the '
86+ # 'same UIDs, the result returned is probably correct,'
87+ # ' otherwise you may need to create a fresh astroquery.Alma instance.'))
88+
89+ def test_stage_data (self , temp_dir , recwarn ):
8390 alma = Alma ()
8491 alma .cache_location = temp_dir
8592
@@ -100,11 +107,18 @@ def test_stage_data(self, temp_dir):
100107 os .path .split (result ['URL' ][0 ])[1 ])
101108
102109 # test re-staging
103- with pytest .raises (requests .HTTPError ) as ex :
104- result = alma .stage_data ([uid ])
105- assert ex .value .args [0 ] == ('Received an error 405: this may indicate you have '
106- 'already staged the data. Try downloading the '
107- 'file URLs directly with download_files.' )
110+ #with pytest.raises(requests.HTTPError) as ex:
111+ # result = alma.stage_data([uid])
112+ #assert ex.value.args[0] == ('Received an error 405: this may indicate you have '
113+ # 'already staged the data. Try downloading the '
114+ # 'file URLs directly with download_files.')
115+
116+ # log.warning doesn't actually make a warning
117+ #result = alma.stage_data([uid])
118+ #w = recwarn.pop()
119+ #assert (str(w.message) == ('Error 405 received. If you have previously staged the '
120+ # 'same UIDs, the result returned is probably correct,'
121+ # ' otherwise you may need to create a fresh astroquery.Alma instance.'))
108122
109123
110124 def test_doc_example (self , temp_dir ):
@@ -172,7 +186,7 @@ def test_cycle1(self, temp_dir):
172186 # A 2-row table may not be OK any more, but that's what it used to
173187 # be...
174188 assert len (uid_url_table_asdm ) == 1
175- assert len (uid_url_table_mous ) == 2
189+ assert len (uid_url_table_mous ) >= 2 # now is len=3 (Nov 17, 2016)
176190
177191 # URL should look like:
178192 # https://almascience.eso.org/dataPortal/requests/anonymous/944120962/ALMA/2012.1.00912.S_uid___A002_X5a9a13_X528_001_of_001.tar/2012.1.00912.S_uid___A002_X5a9a13_X528_001_of_001.tar
0 commit comments