From e67908e0d89ff9e9bab1d8b3059e741cfcefdcbd Mon Sep 17 00:00:00 2001 From: Ramin Gharib Date: Wed, 4 Dec 2024 17:50:59 +0100 Subject: [PATCH] Update files --- kpops/components/common/kubernetes_model.py | 2 - .../helm_wrapper/test_helm_diff.py | 76 +++++++++++-------- 2 files changed, 44 insertions(+), 34 deletions(-) diff --git a/kpops/components/common/kubernetes_model.py b/kpops/components/common/kubernetes_model.py index a638324e1..d396e7ef3 100644 --- a/kpops/components/common/kubernetes_model.py +++ b/kpops/components/common/kubernetes_model.py @@ -78,8 +78,6 @@ def model_dump(self, **_: Any) -> dict[str, Any]: return super().model_dump( mode="json", by_alias=True, - exclude_none=True, - exclude_defaults=True, exclude_unset=True, ) diff --git a/tests/component_handlers/helm_wrapper/test_helm_diff.py b/tests/component_handlers/helm_wrapper/test_helm_diff.py index 8277d6ead..916fcb2f0 100644 --- a/tests/component_handlers/helm_wrapper/test_helm_diff.py +++ b/tests/component_handlers/helm_wrapper/test_helm_diff.py @@ -32,16 +32,20 @@ def test_calculate_changes_unchanged(self, helm_diff: HelmDiff): ] assert list(helm_diff.calculate_changes(templates, templates)) == [ Change( - old_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {}, - }, - new_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {}, - }, + old_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {}, + } + ), + new_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {}, + } + ), ), ] @@ -96,32 +100,40 @@ def test_calculate_changes_matching(self, helm_diff: HelmDiff): ) ) == [ Change( - old_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {"a": "1"}, - }, - new_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {"a": "2"}, - }, + old_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {"a": "1"}, + } + ), + new_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {"a": "2"}, + } + ), ), Change( - old_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {"b": "1"}, - }, - new_value={}, + old_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {"b": "1"}, + } + ), + new_value=None, ), Change( - old_value={}, - new_value={ - "apiVersion": "v1", - "kind": "Deployment", - "metadata": {"c": "1"}, - }, + old_value=None, + new_value=KubernetesManifest( + **{ + "apiVersion": "v1", + "kind": "Deployment", + "metadata": {"c": "1"}, + } + ), ), ]