@@ -412,35 +412,33 @@ def test_fetch_file_from_central(self):
412412 self .tester ._plugincoupling = 'https'
413413 prefix = join (expanduser ("~" ), 'kurt' )
414414 self .clean_up_files .append (prefix + fp )
415- print ("STEFAN" , fp , prefix )
416415 fp_obs = self .tester .fetch_file_from_central (fp , prefix = prefix )
417- print ("STEFAN2" , fp_obs )
418416 self .assertEqual (prefix + fp , fp_obs )
419417 self .assertTrue (filecmp .cmp (fp , fp_obs , shallow = False ))
420418
421- # def test_push_file_to_central(self):
422- # self.tester._plugincoupling = 'filesystem'
423-
424- # ainfo = self.tester.get("/qiita_db/artifacts/%s/" % 1)
425- # fp = ainfo['files']['raw_forward_seqs'][0]['filepath']
426-
427- # # mode: filesystem
428- # fp_obs = self.tester.push_file_to_central(fp)
429- # self.assertEqual(fp, fp_obs)
430-
431- # # non existing mode
432- # with self.assertRaises(ValueError):
433- # self.tester._plugincoupling = 'foo'
434- # self.tester.push_file_to_central(fp)
435-
436- # # change transfer mode to https
437- # self.tester._plugincoupling = 'https'
438- # fp_source = 'foo.bar'
439- # with open(fp_source, 'w') as f:
440- # f.write("this is a test\n")
441- # self.clean_up_files.append(fp_source)
442- # fp_obs = self.tester.push_file_to_central(fp_source)
443- # self.assertEqual(fp_source, fp_obs)
419+ def test_push_file_to_central (self ):
420+ self .tester ._plugincoupling = 'filesystem'
421+
422+ ainfo = self .tester .get ("/qiita_db/artifacts/%s/" % 1 )
423+ fp = ainfo ['files' ]['raw_forward_seqs' ][0 ]['filepath' ]
424+
425+ # mode: filesystem
426+ fp_obs = self .tester .push_file_to_central (fp )
427+ self .assertEqual (fp , fp_obs )
428+
429+ # non existing mode
430+ with self .assertRaises (ValueError ):
431+ self .tester ._plugincoupling = 'foo'
432+ self .tester .push_file_to_central (fp )
433+
434+ # change transfer mode to https
435+ self .tester ._plugincoupling = 'https'
436+ fp_source = 'foo.bar'
437+ with open (fp_source , 'w' ) as f :
438+ f .write ("this is a test\n " )
439+ self .clean_up_files .append (fp_source )
440+ fp_obs = self .tester .push_file_to_central (fp_source )
441+ self .assertEqual (fp_source , fp_obs )
444442
445443
446444if __name__ == '__main__' :
0 commit comments