awscli2/assertions.patch

41 lines
2.1 KiB
Diff
Raw Normal View History

2023-07-26 11:04:15 +00:00
diff --git a/tests/functional/eks/test_kubeconfig.py b/tests/functional/eks/test_kubeconfig.py
index 3d1bcf8..687eef2 100644
--- a/tests/functional/eks/test_kubeconfig.py
+++ b/tests/functional/eks/test_kubeconfig.py
@@ -121,8 +121,9 @@ class TestKubeconfigLoader(unittest.TestCase):
])
loaded_config = self._loader.load_kubeconfig(simple_path)
self.assertEqual(loaded_config.content, content)
- self._validator.validate_config.called_with(Kubeconfig(simple_path,
- content))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, simple_path)
+ self.assertEqual(validated_config.content, content)
def test_load_noexist(self):
no_exist_path = os.path.join(self._temp_directory,
@@ -130,17 +131,18 @@ class TestKubeconfigLoader(unittest.TestCase):
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()))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, no_exist_path)
+ self.assertEqual(validated_config.content, _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()))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, empty_path)
+ self.assertEqual(validated_config.content, _get_new_kubeconfig_content())
def test_load_directory(self):
current_directory = self._temp_directory