From 92e3f98a20101b4ae619e183e6dfe220ed9859c6 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:01:13 -0400 Subject: [PATCH] Bugfix: fix unit-source for pre-release of ansible-core 2.20 (devel and milestone branch) (#903) (#909) SUMMARY CI fix for #904 ISSUE TYPE Bugfix Pull Request COMPONENT NAME tests/unit ADDITIONAL INFORMATION Reviewed-by: Mike Graves Reviewed-by: Bianca Henderson (cherry picked from commit d4fc22c74e9c90ecfc4313166fb678734b794244) Co-authored-by: Yuriy Novostavskiy --- tests/unit/module_utils/test_core.py | 4 ++-- tests/unit/module_utils/test_service.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/module_utils/test_core.py b/tests/unit/module_utils/test_core.py index a49ea12c..05e9b689 100644 --- a/tests/unit/module_utils/test_core.py +++ b/tests/unit/module_utils/test_core.py @@ -44,8 +44,8 @@ def test_warn_on_k8s_version(monkeypatch, stdin, capfd): assert return_value.get("warnings") is not None warnings = return_value["warnings"] assert len(warnings) == 1 - assert "kubernetes" in warnings[0] - assert MINIMAL_K8S_VERSION in warnings[0] + assert "kubernetes" in str(warnings[0]) + assert MINIMAL_K8S_VERSION in str(warnings[0]) dependencies = [ diff --git a/tests/unit/module_utils/test_service.py b/tests/unit/module_utils/test_service.py index 9f8fb730..3d7729ca 100644 --- a/tests/unit/module_utils/test_service.py +++ b/tests/unit/module_utils/test_service.py @@ -202,8 +202,8 @@ def test_service_create_resource_warnings( result, warnings = svc.create(Mock(), pod_definition) assert result == mock_pod_resource_instance.to_dict() - assert warnings[0] == "test warning 1" - assert warnings[1] == "test warning 2" + assert str(warnings[0]) == "test warning 1" + assert str(warnings[1]) == "test warning 2" def test_service_create_resource_check_mode(): @@ -289,8 +289,8 @@ def test_service_apply_existing_resource_warnings( ) assert result == mock_pod_resource_instance.to_dict() - assert warnings[0] == "test warning 1" - assert warnings[1] == "test warning 2" + assert str(warnings[0]) == "test warning 1" + assert str(warnings[1]) == "test warning 2" def test_service_replace_existing_resource(