def setUp(self): self.progress_manager = InMemoryProgressManager( Mock(spec=LocalDirectoryWorkingContext)) self.workunit_provider = Mock(spec=WorkUnitProvider) self.workunit1 = MagicMock(spec=WorkUnit) self.file1 = "file1" self.workunit1.get_filename.return_value = self.file1 self.workunit2 = MagicMock(spec=WorkUnit) self.file2 = "file2" self.workunit2.get_filename.return_value = self.file2 workunits = [self.workunit1, self.workunit2] def get_workunit(index): workunit = workunits[index] self.progress_manager.lock(workunit.get_filename()) return workunit self.workunit_provider.get_workunit.side_effect = ( get_workunit(index) for index in range(2)) image_manager = Mock(spec=ImageManager) self.undertest = ValidationModel(self.workunit_provider, image_manager, None) self.undertest.start_work()
def setUp(self): working_directory = self.get_directory_to_clean() context = LocalDirectoryWorkingContext(working_directory) progress_manager = InMemoryProgressManager(context) parser = AstromParser() builder = RealsWorkUnitBuilder(parser, context, context, progress_manager) undertest = WorkUnitProvider(tasks.get_suffix(tasks.REALS_TASK), context, progress_manager, builder) self.progress_manager = progress_manager self.undertest = undertest
def setUp(self): self.taskid = "id" self.file1 = "file1" self.file2 = "file2" self.file3 = "file3" self.file4 = "file4" self.test_files = [self.file1, self.file2] directory_manager = TestDirectoryManager() progress_manager = InMemoryProgressManager(directory_manager) builder = TestWorkUnitBuilder() self.undertest = WorkUnitProvider(self.taskid, directory_manager, progress_manager, builder) self.directory_manager = directory_manager self.progress_manager = progress_manager self.directory_manager.set_listing(self.taskid, self.test_files)
def setUp(self): self.file1 = "file1" self.file2 = "file2" directory_manager = Mock(spec=LocalDirectoryWorkingContext) self.undertest = InMemoryProgressManager(directory_manager)