def test_invalid_getrunner(self): """Ensure getrunner() throws an exception for an invalid runner.""" bad_runner = 'pizza' with self.assertRaises(Exception) as context: runner.getrunner(bad_runner, {'jobtemplate': 'test'}) self.assertIn("Unknown runner type: {}".format(bad_runner), context.exception)
def test_getrunner(self): """Ensure getrunner() can create a runner subclass.""" result = runner.getrunner('beaker', {'jobtemplate': 'test'}) self.assertIsInstance(result, runner.BeakerRunner)