def __init__(self): self.selection_strategy = AutomaticCorrectionSelectionStrategyThroughRestApi( SERIALIZER_AUTH_USER, SERIALIZER_AUTH_PASS) self.setup_enviroment = SetupEnviroment() self.run_script_command = RunScriptCommand() self.publish_result_visitors = ( PublishResultsVisitorWeb(SERIALIZER_AUTH_USER, SERIALIZER_AUTH_PASS), PublishResultsVisitorMail(SERIALIZER_AUTH_USER, SERIALIZER_AUTH_PASS), )
def testSetupEnviromentShouldCallThePrepareFilesStrategyAndCopyTheScriptFile(self): setup_enviroment = SetupEnviroment() strategy = Mock() setup_enviroment.prepare_files_strategy = strategy automatic_correction = Mock() return_value = TestSetupEnviroment.ORIGINAL_SCRIPT_FILE_PATH + TestSetupEnviroment.SCRIPT_FILE_NAME automatic_correction.script = return_value setup_enviroment.run(automatic_correction, TestSetupEnviroment.DESTINATION_PATH) strategy.prepare_files.assert_called() self.assertTrue(os.path.exists(TestSetupEnviroment.DESTINATION_PATH + TestSetupEnviroment.SCRIPT_FILE_NAME))