Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_make_target_with_processor(self):
task = _DummyTask()
processor = XmlFileProcessor()
target = task.make_target('test.dummy', processor=processor)
self.assertEqual(target._processor, processor)
self.assertIsInstance(target, SingleFileTarget)
def test_default_target(self):
task = _DummyTaskD()
default_target = task.output()
self.assertIsInstance(default_target, SingleFileTarget)
self.assertEqual(f'./resources/test/test_task_on_kart/_DummyTaskD_{task.task_unique_id}.pkl', default_target._target.path)
def make_target(file_path: str, unique_id: Optional[str] = None, processor: Optional[FileProcessor] = None) -> TargetOnKart:
file_path = _make_file_path(file_path, unique_id)
processor = processor or make_file_processor(file_path)
file_system_target = _make_file_system_target(file_path, processor=processor)
return SingleFileTarget(target=file_system_target, processor=processor)