Skip to content

Commit aac4e35

Browse files
committed
correcting tests
1 parent f65f06b commit aac4e35

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

config/kube_config_test.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,12 +1258,13 @@ def test_load_kube_config(self):
12581258
client_configuration=actual)
12591259
self.assertEqual(expected, actual)
12601260

1261-
def test_load_kube_config_from_stringio(self):
1261+
def test_load_kube_config_from_fileish(self):
12621262
expected = FakeConfig(host=TEST_HOST,
12631263
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64)
1264-
kubeconfig = self._create_stringio_config()
1264+
config_fileish = io.StringIO()
1265+
config_fileish.write(yaml.safe_dump(self.TEST_KUBE_CONFIG))
12651266
actual = FakeConfig()
1266-
load_kube_config(config_file=kubeconfig, context="simple_token", client_configuration=actual)
1267+
load_kube_config(config_file=config_fileish, context="simple_token", client_configuration=actual)
12671268
self.assertEqual(expected, actual)
12681269

12691270
def test_load_kube_config_from_dict(self):
@@ -1642,11 +1643,6 @@ def _create_multi_config(self):
16421643
files.append(self._create_temp_file(yaml.safe_dump(part)))
16431644
return ENV_KUBECONFIG_PATH_SEPARATOR.join(files)
16441645

1645-
def _create_stringio_config(self):
1646-
obj = io.StringIO()
1647-
obj.write(self.TEST_KUBE_CONFIG_PART1)
1648-
return obj
1649-
16501646
def test_list_kube_config_contexts(self):
16511647
kubeconfigs = self._create_multi_config()
16521648
expected_contexts = [

0 commit comments

Comments
 (0)