def test_task_invalid_type(self): task = Task(task_type='invalid_type_xyz') with pytest.raises(SystemExit) as error: task.get_name() self.assertEqual(error.type, SystemExit) self.assertEqual(error.value.code, 1)
def test_task_get_name(self): # run task = Task(task_type=Task.TYPE_RUN) self.assertEqual(task.get_name(), 'Run') # parse file task = Task(task_type=Task.TYPE_PARSE_FILE) self.assertEqual(task.get_name(), 'Parse file') # copy file task = Task(task_type=Task.TYPE_COPY_FILE) self.assertEqual(task.get_name(), 'Copy file')