Exemple #1
0
    def test_dry_run(self):
        self.cli_params['dryrun'] = True
        self.transfer_request_submitter = DownloadStreamRequestSubmitter(
            self.transfer_manager, self.result_queue, self.cli_params)
        fileinfo = FileInfo(dest=self.filename,
                            dest_type='local',
                            operation_name='download',
                            src=self.bucket + '/' + self.key,
                            src_type='s3',
                            compare_key=self.key)
        self.transfer_request_submitter.submit(fileinfo)

        result = self.result_queue.get()
        self.assertIsInstance(result, DryRunResult)
        self.assertEqual(result.transfer_type, 'download')
        self.assertEqual(result.src, 's3://' + self.bucket + '/' + self.key)
        self.assertEqual(result.dest, '-')
Exemple #2
0
 def setUp(self):
     super(TestDownloadStreamRequestSubmitter, self).setUp()
     self.filename = '-'
     self.cli_params['is_stream'] = True
     self.transfer_request_submitter = DownloadStreamRequestSubmitter(
         self.transfer_manager, self.result_queue, self.cli_params)