correcting tests
This commit is contained in:
parent
f65f06b1ed
commit
aac4e35ca9
@ -1258,12 +1258,13 @@ class TestKubeConfigLoader(BaseTestCase):
|
|||||||
client_configuration=actual)
|
client_configuration=actual)
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_load_kube_config_from_stringio(self):
|
def test_load_kube_config_from_fileish(self):
|
||||||
expected = FakeConfig(host=TEST_HOST,
|
expected = FakeConfig(host=TEST_HOST,
|
||||||
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64)
|
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64)
|
||||||
kubeconfig = self._create_stringio_config()
|
config_fileish = io.StringIO()
|
||||||
|
config_fileish.write(yaml.safe_dump(self.TEST_KUBE_CONFIG))
|
||||||
actual = FakeConfig()
|
actual = FakeConfig()
|
||||||
load_kube_config(config_file=kubeconfig, context="simple_token", client_configuration=actual)
|
load_kube_config(config_file=config_fileish, context="simple_token", client_configuration=actual)
|
||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_load_kube_config_from_dict(self):
|
def test_load_kube_config_from_dict(self):
|
||||||
@ -1642,11 +1643,6 @@ class TestKubeConfigMerger(BaseTestCase):
|
|||||||
files.append(self._create_temp_file(yaml.safe_dump(part)))
|
files.append(self._create_temp_file(yaml.safe_dump(part)))
|
||||||
return ENV_KUBECONFIG_PATH_SEPARATOR.join(files)
|
return ENV_KUBECONFIG_PATH_SEPARATOR.join(files)
|
||||||
|
|
||||||
def _create_stringio_config(self):
|
|
||||||
obj = io.StringIO()
|
|
||||||
obj.write(self.TEST_KUBE_CONFIG_PART1)
|
|
||||||
return obj
|
|
||||||
|
|
||||||
def test_list_kube_config_contexts(self):
|
def test_list_kube_config_contexts(self):
|
||||||
kubeconfigs = self._create_multi_config()
|
kubeconfigs = self._create_multi_config()
|
||||||
expected_contexts = [
|
expected_contexts = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user