def test_bundle_add_to_tarfile(self): mock_tar = self.MockFileContextManager() self.mock_tarfile_open.return_value = mock_tar job_source_bundle = JobSourceBundle(self.fake_bundle_name, self.fake_target_name) job_source_bundle.bundle() mock_tar.add.assert_called_with('.')
def test_bundle_calls_tarfile_open_with_correct_arguments(self): archive_name = '{}{}.tgz'.format(self.fake_target_name, self.fake_bundle_name) job_source_bundle = JobSourceBundle(self.fake_bundle_name, self.fake_target_name) job_source_bundle.bundle() self.mock_tarfile_open.assert_called_with(archive_name, 'w:gz')