def test_download_multiple_files(self, exists, isdir, asyncio_, main): exists.return_value = True isdir.return_value = True downloader = Downloader('test', bucket='bucket', region_name='south') downloader.download(range(3)) asyncio_.get_event_loop.assert_called_with() loop = asyncio_.get_event_loop.return_value self.assertTrue(loop.run_until_complete.called) main.assert_called_once_with(loop, (1, 2))
def test_download_single_file(self, exists, isdir, asyncio_, main): exists.return_value = True isdir.return_value = True downloader = Downloader('test') downloader.download('test.xz') asyncio_.get_event_loop.assert_called_with() loop = asyncio_.get_event_loop.return_value self.assertTrue(loop.run_until_complete.called) main.assert_called_once_with(loop, ('test.xz',))
def test_download_no_file(self, exists, isdir): exists.return_value = True isdir.return_value = True downloader = Downloader('test', bucket='bucket', region_name='south') self.assertIsNone(downloader.download('')) self.assertIsNone(downloader.download([]))
def test_download_no_file(self, exists, isdir): exists.return_value = True isdir.return_value = True downloader = Downloader('test') self.assertIsNone(downloader.download('')) self.assertIsNone(downloader.download([]))