def test_not_wario_task(self):
     #throw exception if not wario task.
     task = NotWarioTask()
     try:
         wario_run(task)
         self.fail("Should not run task")
     except ValueError as e:
         self.assertEqual(e.message, "Task is not an instance of WarioTask, instead found NotWarioTask")
 def test_with_mock_output_fails(self):
     task = WarioTaskWithDefaultCompleteFail()
     try:
         wario_run(task)
         self.fail("Should throw no complete exception")
     except WarioTaskNotComplete:
         pass
     finally:
         self.assertFalse(task.complete())
 def test_with_reqs_recurses_but_dependency_fails(self):
     task = WarioTaskWhereDependenciesFail()
     try:
         wario_run(task)
         self.fail("It should throw an exception")
     except WarioTaskNotComplete:
         pass
     finally:
         self.assertFalse(task.complete())
 def test_no_reqs_runs_but_does_not_complete(self):
     task = WarioTaskNoDependenciesThatFails()
     try:
         wario_run(task)
         self.fail("Should throw exception")
     except WarioTaskNotComplete:
         pass
     finally:
         self.assertFalse(task.complete())
 def test_no_reqs_just_runs_and_completes(self):
     task = WarioTaskNoDependenciesThatRuns()
     wario_run(task)
     self.assertTrue(task.complete())
 def test_wrapper_task(self):
     task = FakeWarioWrapperClass()
     wario_run(task)
     self.assertTrue(task.complete())
 def test_with_mock_output_succeeds(self):
     task = WarioTaskWithDefaultCompleteSuccess()
     wario_run(task)
     self.assertTrue(task.complete())
 def test_with_reqs_recurses_and_completes_all_tasks(self):
     task = WarioTaskWithDependencies()
     wario_run(task)
     self.assertTrue(task.complete())
     self.assertTrue(all([t.complete() for t in [task.requires()]]))