def create_job(config=None, name=None): if config is None: config = create_config() obj = K8sJob( config=config, name=name ) return obj
def test_init_no_args(self): try: K8sJob() self.fail("Should not fail.") except SyntaxError: pass except IOError: pass except Exception as err: self.fail("Unhandled exception: [ {0} ]".format(err.__class__.__name__))
def test_init_with_invalid_config(self): config = object() with self.assertRaises(SyntaxError): K8sJob(config=config)