def handle(self, *args, **options): destination_dir = None if len(args) == 1: destination_dir = args[0] destination_dir = destination_dir or '/tmp/addressbase_basic' downloader = AddressBaseBasicDownloader() downloaded_files = downloader.download(destination_dir)
def handle(self, *args, **options): destination_dir = None if len(args) == 1: destination_dir = args[0] destination_dir = destination_dir or "/tmp/addressbase_basic" downloader = AddressBaseBasicDownloader() downloaded_files = downloader.download(destination_dir)
def _download(self, destination_dir): print 'downloading' downloader = AddressBaseBasicDownloader() return downloader.download(destination_dir)
def test_finds_dir_with_latest_full_file(self): self._mock_find_dir() with mock.patch('ftplib.FTP'), self.mock_env(): dl = AddressBaseBasicDownloader() dl.download(self.root_dir.full_path) self.assertTrue(dl.find_dir_with_latest_full_file.called)