def test_validate_type(self): kog = TestData.kog kw = TestData.setup_kwargs(kog) setup_kot = object_setUp(KubeOaatType, TestData.kot) setup = object_setUp(KubeOaatGroup, kog) next(setup_kot) next(setup) ogo = OaatGroupOverseer(**kw) ogo.validate_oaat_type() next(setup) # delete KubeOaatGroup next(setup_kot) # delete KubeOaatType
def test_podspec_emptyspec(self): kog = TestData.kog_emptyspec kw = TestData.setup_kwargs(kog) setup_kot = object_setUp(KubeOaatType, TestData.kot) setup = object_setUp(KubeOaatGroup, kog) next(setup_kot) next(setup) og = OaatGroupOverseer(**kw) with self.assertRaises(ProcessingComplete) as exc: og.validate_oaat_type() self.assertEqual(exc.exception.ret['error'], 'unknown oaat type None') next(setup) next(setup_kot)
def extraSetUp(self, kot, kog): self.kw = TestData.setup_kwargs(kog) self.setup_kot = object_setUp(KubeOaatType, kot) self.setup = object_setUp(KubeOaatGroup, kog) next(self.setup_kot) next(self.setup) ogo = OaatGroupOverseer(**self.kw) self.assertIsInstance(ogo, OaatGroupOverseer) self.assertIsInstance(ogo.oaattype, OaatType) return ogo
def test_create_none(self): kog = TestData.kog kw = TestData.setup_kwargs(kog) setup_kot = object_setUp(KubeOaatType, TestData.kot) setup = object_setUp(KubeOaatGroup, kog) next(setup_kot) next(setup) ogo = OaatGroupOverseer(**kw) self.assertIsInstance(ogo, OaatGroupOverseer) self.assertEqual(ogo.freq, datetime.timedelta(seconds=60)) self.assertIsInstance(ogo.oaattype, OaatType) next(setup) # delete KubeOaatGroup next(setup_kot) # delete KubeOaatType
def test_invalid_none(self): with self.assertRaises(TypeError): OaatGroupOverseer(None)
def test_invalid_object(self): with self.assertRaises(ValueError) as exc: OaatGroupOverseer(a=1) self.assertRegexpMatches( str(exc.exception), 'Overseer must be called with full kopf kwargs.*')