def test_bundle_job_adds_config_files(self): mock_job_source_bundle, mock_tar = self._setup_archive_and_tar() self.mock_glob_glob.return_value = ['fake_config_filename.config.yaml'] job_bundler = JobBundler('fake_name', {}, None, mock_job_source_bundle) job_bundler._bundle_job() add_config_call = call('fake_config_filename.config.yaml', arcname='fake_name/fake_config_filename.config.yaml') mock_tar.add.assert_has_calls([add_config_call])
def test_bundle_job_opens_file(self): mock_job_source_bundle = self.MockJobSourceBundle('fake_source_archive_name') job_bundler = JobBundler('fake_name', self._default_config, None, mock_job_source_bundle) job_bundler._bundle_job() self.mock_tarfile_open.assert_called_with(self.temp_directory + '/fake_name.tgz', 'w:gz')