Skip to content

Commit 738ab79

Browse files
committed
add testing https protocol
1 parent 0cc6a50 commit 738ab79

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

qiita_client/tests/test_qiita_client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,14 @@ def test_fetch_file_from_central(self):
408408
self.tester._plugincoupling = 'foo'
409409
self.tester.fetch_file_from_central(fp)
410410

411+
# change transfer mode to https
412+
self.tester._plugincoupling = 'https'
413+
prefix = join(expanduser("~"), 'kurt')
414+
self.clean_up_files.append(prefix + fp)
415+
fp_obs = self.tester.fetch_file_from_central(fp, prefix=prefix)
416+
self.assertEqual(prefix + fp, fp_obs)
417+
self.assertTrue(filecmp.cmp(fp, fp_obs, shallow=False))
418+
411419
def test_push_file_to_central(self):
412420
self.tester._plugincoupling = 'filesystem'
413421

@@ -423,6 +431,15 @@ def test_push_file_to_central(self):
423431
self.tester._plugincoupling = 'foo'
424432
self.tester.push_file_to_central(fp)
425433

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)
442+
426443

427444
if __name__ == '__main__':
428445
main()

0 commit comments

Comments
 (0)