def test_cleanup_calls_remove_when_job_archive_exists(self):
     self.mock_os_exists.return_value = True
     job_source_bundle = JobSourceBundle(self.fake_bundle_name,
                                         self.fake_target_name)
     job_source_bundle.cleanup()
     self.mock_os_remove.assert_called_with('{}{}.tgz'.format(
         self.fake_target_name, self.fake_bundle_name))
 def test_cleanup_does_not_calls_remove_when_job_archive_exists(self):
     self.mock_os_exists.return_value = False
     job_source_bundle = JobSourceBundle(self.fake_bundle_name,
                                         self.fake_target_name)
     job_source_bundle.cleanup()
     self.mock_os_remove.assert_not_called()
 def test_cleanup_checks_job_archive_exists(self):
     job_source_bundle = JobSourceBundle(self.fake_bundle_name,
                                         self.fake_target_name)
     job_source_bundle.cleanup()
     self.mock_os_exists.assert_called_with('{}{}.tgz'.format(
         self.fake_target_name, self.fake_bundle_name))