@@ -207,33 +207,33 @@ def _delete_test_data(foundry_obj):
207207
208208
209209def test_foundry_init ():
210- f = Foundry (test_dataset , download = False , authorizers = auths )
210+ f = Foundry (authorizers = auths )
211211 assert isinstance (f .forge_client , Forge )
212212 assert isinstance (f .connect_client , MDFConnectClient )
213213
214214 if not is_gha :
215215 assert isinstance (f .dlhub_client , DLHubClient )
216216
217- f2 = Foundry (test_dataset , download = False , authorizers = auths , no_browser = False , no_local_server = True )
217+ f2 = Foundry (authorizers = auths , no_browser = False , no_local_server = True )
218218 assert isinstance (f2 .dlhub_client , DLHubClient )
219219 assert isinstance (f2 .forge_client , Forge )
220220 assert isinstance (f2 .connect_client , MDFConnectClient )
221221
222- f3 = Foundry (test_dataset , download = False , authorizers = auths , no_browser = True , no_local_server = False )
222+ f3 = Foundry (authorizers = auths , no_browser = True , no_local_server = False )
223223 assert isinstance (f3 .dlhub_client , DLHubClient )
224224 assert isinstance (f3 .forge_client , Forge )
225225 assert isinstance (f3 .connect_client , MDFConnectClient )
226226
227227
228228def test_list ():
229- f = Foundry (test_dataset , download = False , authorizers = auths )
229+ f = Foundry (authorizers = auths )
230230 ds = f .list ()
231231 assert isinstance (ds , pd .DataFrame )
232232 assert len (ds ) > 0
233233
234234
235235def test_search ():
236- f = Foundry (test_dataset , download = False , authorizers = auths )
236+ f = Foundry (authorizers = auths )
237237 q = "Elwood"
238238 ds = f .search (q )
239239
@@ -245,20 +245,25 @@ def test_search():
245245
246246
247247def test_metadata_pull ():
248- f = Foundry (test_dataset , download = False , authorizers = auths )
248+ f = Foundry (authorizers = auths )
249+ assert f .dc == {}
250+ f = f .load (test_dataset , download = False , authorizers = auths )
249251 assert f .dc ["titles" ][0 ]["title" ] == expected_title
250252
251253
252254def test_download_https ():
253- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths )
255+ f = Foundry (authorizers = auths )
254256 _delete_test_data (f )
257+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
255258
256259 assert f .dc ["titles" ][0 ]["title" ] == expected_title
257260 _delete_test_data (f )
258261
259262
260263def test_dataframe_load ():
261- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths )
264+ f = Foundry (authorizers = auths )
265+ _delete_test_data (f )
266+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
262267
263268 res = f .load_data ()
264269 X , y = res ['train' ]
@@ -271,7 +276,9 @@ def test_dataframe_load():
271276
272277
273278def test_dataframe_load_split ():
274- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths )
279+ f = Foundry (authorizers = auths )
280+ _delete_test_data (f )
281+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
275282
276283 res = f .load_data (splits = ['train' ])
277284 X , y = res ['train' ]
@@ -284,7 +291,9 @@ def test_dataframe_load_split():
284291
285292
286293def test_dataframe_load_split_wrong_split_name ():
287- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths )
294+ f = Foundry (authorizers = auths )
295+ _delete_test_data (f )
296+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
288297
289298 with pytest .raises (Exception ) as exc_info :
290299 f .load_data (splits = ['chewbacca' ])
@@ -297,15 +306,19 @@ def test_dataframe_load_split_wrong_split_name():
297306
298307@pytest .mark .skip (reason = 'No clear examples of datasets without splits - likely to be protected against soon.' )
299308def test_dataframe_load_split_but_no_splits ():
300- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths )
309+ f = Foundry (authorizers = auths )
310+ _delete_test_data (f )
311+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
301312
302313 with pytest .raises (ValueError ):
303314 f .load_data (splits = ['train' ])
304315 _delete_test_data (f )
305316
306317
307318def test_dataframe_load_doi ():
308- f = Foundry (test_doi , download = True , globus = False , authorizers = auths )
319+ f = Foundry (authorizers = auths )
320+ _delete_test_data (f )
321+ f = f .load (test_doi , download = True , globus = False , authorizers = auths )
309322
310323 res = f .load_data ()
311324 X , y = res ['train' ]
@@ -319,16 +332,21 @@ def test_dataframe_load_doi():
319332
320333@pytest .mark .skipif (bool (is_gha ), reason = "Test does not succeed on GHA - no Globus endpoint" )
321334def test_download_globus ():
322- f = Foundry (test_dataset , download = True , authorizers = auths , no_browser = True , no_local_server = True )
335+ f = Foundry (authorizers = auths , no_browser = True , no_local_server = True )
323336 _delete_test_data (f )
337+ f = f .load (test_dataset , download = True )
324338
325339 assert f .dc ["titles" ][0 ]["title" ] == expected_title
326340 _delete_test_data (f )
327341
328342
329343@pytest .mark .skipif (bool (is_gha ), reason = "Test does not succeed on GHA - no Globus endpoint" )
330344def test_globus_dataframe_load ():
331- f = Foundry (test_dataset , download = True , authorizers = auths , no_browser = True , no_local_server = True )
345+ f = Foundry (authorizers = auths , no_browser = True , no_local_server = True )
346+
347+ _delete_test_data (f )
348+
349+ f = f .load (test_dataset , download = True )
332350
333351 res = f .load_data ()
334352 X , y = res ['train' ]
@@ -482,7 +500,9 @@ def test_check_status():
482500
483501
484502def test_to_pytorch ():
485- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths , no_browser = True , no_local_server = True )
503+ f = Foundry (authorizers = auths , no_browser = True , no_local_server = True )
504+ _delete_test_data (f )
505+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
486506
487507 raw = f .load_data ()
488508
@@ -495,7 +515,9 @@ def test_to_pytorch():
495515
496516
497517def test_to_tensorflow ():
498- f = Foundry (test_dataset , download = True , globus = False , authorizers = auths , no_browser = True , no_local_server = True )
518+ f = Foundry (authorizers = auths , no_browser = True , no_local_server = True )
519+ _delete_test_data (f )
520+ f = f .load (test_dataset , download = True , globus = False , authorizers = auths )
499521
500522 raw = f .load_data ()
501523
0 commit comments