Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:wombelix
aws-cli-2
0004-fix-mystery-function-call-in-eks-tests.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-fix-mystery-function-call-in-eks-tests.patch of Package aws-cli-2
From b948c535301f88dd167d084897735de367ba701d Mon Sep 17 00:00:00 2001 From: Nate Prewitt <nate.prewitt@gmail.com> Date: Mon, 14 Aug 2023 23:44:12 -0600 Subject: [PATCH] Fix mystery function call in EKS tests --- awscli/customizations/eks/kubeconfig.py | 7 +++++++ tests/functional/eks/test_kubeconfig.py | 16 +++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/awscli/customizations/eks/kubeconfig.py b/awscli/customizations/eks/kubeconfig.py index aeae45bfa1fe..a680384a3153 100644 --- a/awscli/customizations/eks/kubeconfig.py +++ b/awscli/customizations/eks/kubeconfig.py @@ -67,6 +67,13 @@ def has_cluster(self, name): return name in [cluster['name'] for cluster in self.content['clusters'] if 'name' in cluster] + def __eq__(self, other): + return ( + isinstance(other, Kubeconfig) + and self.path == other.path + and self.content == other.content + ) + class KubeconfigValidator(object): def __init__(self): diff --git a/tests/functional/eks/test_kubeconfig.py b/tests/functional/eks/test_kubeconfig.py index 43b2221d175a..2eeb30b36e1c 100644 --- a/tests/functional/eks/test_kubeconfig.py +++ b/tests/functional/eks/test_kubeconfig.py @@ -119,8 +119,9 @@ def test_load_simple(self): ]) loaded_config = self._loader.load_kubeconfig(simple_path) self.assertEqual(loaded_config.content, content) - self._validator.validate_config.called_with(Kubeconfig(simple_path, - content)) + self._validator.validate_config.assert_called_with( + Kubeconfig(simple_path, content) + ) def test_load_noexist(self): no_exist_path = os.path.join(self._temp_directory, @@ -128,17 +129,18 @@ def test_load_noexist(self): loaded_config = self._loader.load_kubeconfig(no_exist_path) self.assertEqual(loaded_config.content, _get_new_kubeconfig_content()) - self._validator.validate_config.called_with( - Kubeconfig(no_exist_path, _get_new_kubeconfig_content())) + self._validator.validate_config.assert_called_with( + Kubeconfig(no_exist_path, _get_new_kubeconfig_content()) + ) def test_load_empty(self): empty_path = self._clone_config("valid_empty_existing") loaded_config = self._loader.load_kubeconfig(empty_path) self.assertEqual(loaded_config.content, _get_new_kubeconfig_content()) - self._validator.validate_config.called_with( - Kubeconfig(empty_path, - _get_new_kubeconfig_content())) + self._validator.validate_config.assert_called_with( + Kubeconfig(empty_path, _get_new_kubeconfig_content()) + ) def test_load_directory(self): current_directory = self._temp_directory
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor