diff --git a/blivet/tasks/task.py b/blivet/tasks/task.py index 31e8dd450..61a8ae243 100644 --- a/blivet/tasks/task.py +++ b/blivet/tasks/task.py @@ -71,6 +71,9 @@ def _availabilityErrors(self): dependsOn = [] + def __str__(self): + return "unimplemented task" + def doTask(self, *args, **kwargs): raise NotImplementedError() @@ -82,6 +85,9 @@ class BasicApplication(Task): # TASK methods + def __str__(self): + return str(self.ext) + @property def _availabilityErrors(self): errors = self.ext.availabilityErrors diff --git a/tests/tasks_test/basic_tests.py b/tests/tasks_test/basic_tests.py index 381497326..3aa5492c1 100644 --- a/tests/tasks_test/basic_tests.py +++ b/tests/tasks_test/basic_tests.py @@ -38,3 +38,10 @@ def testAvailability(self): available_app = BasicAvailableApplication() self.assertTrue(available_app.available) self.assertEqual(available_app.availabilityErrors, []) + + def testNames(self): + # Every basic application takes its string representation from + # the external resource. + unavailable_app = BasicUnavailableApplication() + self.assertTrue(isinstance(unavailable_app, task.BasicApplication)) + self.assertEqual(str(unavailable_app), str(unavailable_app.ext))