From 605bfdb7ba1126610a7b9f14d1f97444193e1f73 Mon Sep 17 00:00:00 2001 From: Jakub Smolar Date: Fri, 10 Nov 2023 13:49:14 +0100 Subject: [PATCH] Extend OpenShiftObject class with LifecycleObject --- testsuite/objects/__init__.py | 2 +- testsuite/openshift/objects/__init__.py | 4 +++- testsuite/openshift/objects/ingress.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/testsuite/objects/__init__.py b/testsuite/objects/__init__.py index 063e5f68..5728834f 100644 --- a/testsuite/objects/__init__.py +++ b/testsuite/objects/__init__.py @@ -151,7 +151,7 @@ def delete(self): class Authorino(LifecycleObject): - """Authorino instance""" + """Authorino interface""" @abc.abstractmethod def wait_for_ready(self): diff --git a/testsuite/openshift/objects/__init__.py b/testsuite/openshift/objects/__init__.py index 9314ef82..2e827394 100644 --- a/testsuite/openshift/objects/__init__.py +++ b/testsuite/openshift/objects/__init__.py @@ -3,6 +3,8 @@ from openshift import APIObject +from testsuite.objects import LifecycleObject + def modify(func): """Wraps method of a subclass of OpenShiftObject to use modify_and_apply when the object @@ -28,7 +30,7 @@ def _wrap(self, *args, **kwargs): return _wrap -class OpenShiftObject(APIObject): +class OpenShiftObject(APIObject, LifecycleObject): """Custom APIObjects which tracks if the object was already committed to the server or not""" def __init__(self, dict_to_model=None, string_to_model=None, context=None): diff --git a/testsuite/openshift/objects/ingress.py b/testsuite/openshift/objects/ingress.py index 02f4d45b..e4652ed4 100644 --- a/testsuite/openshift/objects/ingress.py +++ b/testsuite/openshift/objects/ingress.py @@ -1,7 +1,6 @@ """Kubernetes Ingress object""" from typing import Any, Dict, List, Optional, TYPE_CHECKING -from testsuite.objects import LifecycleObject from testsuite.openshift.objects import OpenShiftObject if TYPE_CHECKING: @@ -9,7 +8,7 @@ from testsuite.openshift.client import OpenShiftClient -class Ingress(OpenShiftObject, LifecycleObject): +class Ingress(OpenShiftObject): """Represents Kubernetes Ingress object""" @classmethod