Пример #1
0
 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
Пример #2
0
 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)
Пример #3
0
 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
Пример #4
0
 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
Пример #5
0
 def test_invalid_none(self):
     with self.assertRaises(TypeError):
         OaatGroupOverseer(None)
Пример #6
0
 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.*')