def setUp(self): super().setUp() test_utils.setup() self.user = User('ConfigServiceTest', {AUTH_USERNAME: '******'}) self.config_service = ConfigService(AnyUserAuthorizer(), test_utils.temp_folder)
def setUp(self): super().setUp() test_utils.setup() executor._process_creator = _MockProcessWrapper self.executor_service = ExecutionService(AnyUserAuthorizer(), _IdGeneratorMock()) self.feature = FileDownloadFeature(UserFileStorage(b'123456'), test_utils.temp_folder) self.feature.subscribe(self.executor_service)
def setUp(self): test_utils.setup() executor._process_creator = _MockProcessWrapper authorizer = Authorizer([], [], [], EmptyGroupProvider()) self.logging_service = ExecutionLoggingService(test_utils.temp_folder, LogNameCreator(), authorizer) self.executor_service = ExecutionService(AnyUserAuthorizer(), _IdGeneratorMock()) self.controller = ExecutionLoggingController(self.executor_service, self.logging_service) self.controller.start()
def setUp(self) -> None: super().setUp() test_utils.setup() self.patcher = patch('sched.scheduler') self.scheduler_mock = MagicMock() self.patcher.start().return_value = self.scheduler_mock schedule_service._sleep = MagicMock() schedule_service._sleep.side_effect = lambda x: time.sleep(0.001) self.config_service = ConfigService(AnyUserAuthorizer(), test_utils.temp_folder) self.create_config('my_script_A') self.create_config('unschedulable-script', scheduling_enabled=False) self.execution_service = MagicMock() self.schedule_service = ScheduleService(self.config_service, self.execution_service, test_utils.temp_folder) date_utils._mocked_now = mocked_now