def test_http_1(self): res = downloader.get_protocol_from_url("http://my.path.to/thisfile") self.assertEqual(res, "http")
def test_sftp_1(self): url = "sftp://test.rebex.net/pub/example/WinFormClient.png" downloader.protocol_dispatch[downloader.get_protocol_from_url(url)]( url, "/tmp/") self.assertTrue(os.path.exists("/tmp/WinFormClient.png")) downloader.remove_data('/tmp/', "WinFormClient.png")
def test_http_1(self): url = "http://github.com/kennethreitz/requests/tarball/master" downloader.protocol_dispatch[downloader.get_protocol_from_url(url)]( url, "/tmp/") self.assertTrue(os.path.exists("/tmp/master")) downloader.remove_data('/tmp/', "master")
def test_ftp_1(self): url = "ftp://test.rebex.net/pub/example/KeyGeneratorSmall.png" downloader.protocol_dispatch[downloader.get_protocol_from_url(url)]( url, "/tmp/") self.assertTrue(os.path.exists("/tmp/KeyGeneratorSmall.png")) downloader.remove_data('/tmp/', "KeyGeneratorSmall.png")