def test_linkshare_download(self): url = 'aftp.linksynergy.com' path = '/1237_1921634_mp.txt.gz' username = '' password = '' port = '' downloader = FtpDownloader(url, username, password, port) filename = downloader.download(path) self.assertEqual('downloads/1237_1921634_mp.txt.gz', filename)
def test_cj_download(self): url = 'datatransfer.cj.com' path = '/outgoing/productcatalog/156577/Urban_Outfitters-Urban_Outfitters_Product_Catalog.txt.gz' username = '' password = '' port = '' downloader = FtpDownloader(url, username, password, port) filename = downloader.download(path) self.assertEqual('downloads/Urban_Outfitters-Urban_Outfitters_Product_Catalog.txt.gz', filename)
def test_shareasale_connect(self): url = 'datafeeds.shareasale.com' path = '/45890/45890.txt.gz' username = '' password = '' port = '' downloader = FtpDownloader(url, username, password, port) filename = downloader.download(path) self.assertEqual('downloads/45890.txt.gz', filename)
def test_downloader_factory(self): self.assertIsInstance( HttpsDownloader(SiteConfig('p', 'u', 'h'), 'file'), get_downloader('https')) self.assertIsInstance( HttpDownloader(SiteConfig('p', 'u', 'h'), 'file'), get_downloader('http')) self.assertIsInstance(FtpDownloader(SiteConfig('p', 'u', 'h'), 'file'), get_downloader('ftp')) self.assertIsInstance( SftpDownloader(SiteConfig('p', 'u', 'h'), 'file'), get_downloader('sftp'))