def testLastModifier(self): self.assertEqual( kubernetesobject.KubernetesObject({ "metadata": { "annotations": { "serving.knative.dev/lastModifier": "*****@*****.**" } } }).last_modifier, "*****@*****.**")
def testReady_missing(self): self.assertIsNone( kubernetesobject.KubernetesObject({ "status": { "conditions": [{ "type": "ConfigurationsReady", "status": "False", }, { "type": "RoutesReady", "status": "True" }] } }).ready)
def testReady(self, ready_status, expected): self.assertEqual( kubernetesobject.KubernetesObject({ "status": { "conditions": [{ "type": "Ready", "status": ready_status }, { "type": "RoutesReady", "status": "True" }] } }).ready, expected)
def testReadyCondition(self): self.assertFalse( kubernetesobject.KubernetesObject({ "status": { "conditions": [{ "type": "Ready", "status": "False" }, { "type": "RoutesReady", "status": "True" }] } }).ready_condition.status)
def testReadySymbolAndColor_utf8(self, ready_status, expected): console_attr.ResetConsoleAttr("utf-8") self.assertEqual( kubernetesobject.KubernetesObject({ "status": { "conditions": [{ "type": "Ready", "status": ready_status }, { "type": "RoutesReady", "status": "True" }] } }).ReadySymbolAndColor(), expected)
def testReadySymbol(self, ready_status, expected): console_attr.ResetConsoleAttr("ascii") self.assertEqual( kubernetesobject.KubernetesObject({ "status": { "conditions": [{ "type": "Ready", "status": ready_status }, { "type": "RoutesReady", "status": "True" }] } }).ready_symbol, expected)