def test_remote_environment_not_called_if_remote_server_is_already_clean(self): self.remote_env_mock.clean_remote_server = mock.Mock() study = StudyDTO(path="hello") study.local_final_zipfile_path = "hello.zip" study.remote_server_is_clean = True new_study = self.remote_server_cleaner.clean(study) self.remote_env_mock.clean_remote_server.assert_not_called() assert new_study == study
def test_when_study_finished_with_error_check_if_study_is_done_returns_true( result, with_error, logs_downloaded, local_final_zipfile_path, remote_server_is_clean, final_zip_extracted, ): my_study = StudyDTO(path="hello", job_id=42, started=True, finished=True) my_study.with_error = with_error my_study.logs_downloaded = logs_downloaded my_study.local_final_zipfile_path = local_final_zipfile_path my_study.remote_server_is_clean = remote_server_is_clean my_study.final_zip_extracted = final_zip_extracted assert StudyRetriever.check_if_study_is_done(my_study) is result