@@ -29,6 +29,8 @@ def data_path(filename):
2929 'downloadRequest786572566script.sh' ,
3030 'http://almascience.eso.org/rh/requests/anonymous/786978956/script' :
3131 'downloadRequest786978956script.sh' ,
32+ 'http://almascience.eso.org/rh/requests/anonymous/787632764/script' :
33+ 'downloadRequest787632764script.sh' ,
3234 },
3335 'POST' : {'http://almascience.eso.org/rh/submission' :
3436 'initial_response.html' }
@@ -129,7 +131,7 @@ def test_parse_staging_request_page_asdm(monkeypatch):
129131 alma .dataarchive_url = _get_dataarchive_url ()
130132 monkeypatch .setattr (alma , '_request' , alma_request )
131133
132- with open (data_path ('request_786572566.html' ), 'rb ' ) as f :
134+ with open (data_path ('request_786572566.html' ), 'r ' ) as f :
133135 response = MockResponse (content = f .read ())
134136
135137 alma ._staging_log = {'data_list_url' : 'request_786572566.html' }
@@ -144,7 +146,7 @@ def test_parse_staging_request_page_mous(monkeypatch):
144146 alma .dataarchive_url = _get_dataarchive_url ()
145147 monkeypatch .setattr (alma , '_request' , alma_request )
146148
147- with open (data_path ('request_786978956.html' ), 'rb ' ) as f :
149+ with open (data_path ('request_786978956.html' ), 'r ' ) as f :
148150 response = MockResponse (content = f .read ())
149151
150152 alma ._staging_log = {'data_list_url' : 'request_786978956.html' }
@@ -153,3 +155,19 @@ def test_parse_staging_request_page_mous(monkeypatch):
153155 assert tbl [0 ]['uid' ] == 'uid://A002/X3216af/X31'
154156 np .testing .assert_approx_equal (tbl [0 ]['size' ], 0.2093 )
155157 assert len (tbl ) == 26
158+
159+ def test_parse_staging_request_page_mous_cycle0 (monkeypatch ):
160+ monkeypatch .setattr (Alma , '_get_dataarchive_url' , _get_dataarchive_url )
161+ alma = Alma ()
162+ alma .dataarchive_url = _get_dataarchive_url ()
163+ monkeypatch .setattr (alma , '_request' , alma_request )
164+
165+ with open (data_path ('request_787632764.html' ), 'r' ) as f :
166+ response = MockResponse (content = f .read ())
167+
168+ alma ._staging_log = {'data_list_url' : 'request_787632764.html' }
169+ tbl = alma ._parse_staging_request_page (response )
170+ assert tbl [0 ]['URL' ] == 'https://almascience.eso.org/dataPortal/requests/anonymous/787632764/ALMA/2011.0.00121.S_2012-08-16_001_of_002.tar/2011.0.00121.S_2012-08-16_001_of_002.tar'
171+ assert tbl [0 ]['uid' ] == 'uid://A002/X327408/X246'
172+ np .testing .assert_approx_equal (tbl [0 ]['size' ], 5.9 )
173+ assert len (tbl ) == 32
0 commit comments