def test_warnings(self):
        cfg = _utils.create_config()

        if _utils.is_reachable(cfg):
            objs = K8sEvent(config=cfg, name="yo").warnings()
            for x in objs:
                self.assertIsInstance(x, K8sEvent)
Example #2
0
def create_event(config=None, name=None):
    if config is None:
        config = create_config()
    obj = K8sEvent(
        config=config,
        name=name
    )
    return obj
 def test_init_no_args(self):
     try:
         K8sEvent()
         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):
         K8sEvent(config=config)