supporting 2.7, reading works fine, writing reqs unicode
@@ -1262,6 +1262,11 @@ class TestKubeConfigLoader(BaseTestCase):
expected = FakeConfig(host=TEST_HOST,
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64)
config_file_like_object = io.StringIO()
+ #py3 (won't have unicode) vs py2 (requires it)
+ try:
+ unicode('')
+ config_file_like_object.write(unicode(yaml.safe_dump(self.TEST_KUBE_CONFIG)), errors='replace')
+ except NameError:
config_file_like_object.write(yaml.safe_dump(self.TEST_KUBE_CONFIG))
actual = FakeConfig()
load_kube_config(config_file=config_file_like_object, context="simple_token",
