From 1589ff5aec5b1683ead2620bfe197d831f9b1f4c Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 3 Mar 2015 15:12:40 -0700 Subject: [PATCH] Don't use yaml in FakeNamespace's str() Signed-off-by: Zack Cerza --- teuthology/config.py | 3 +++ teuthology/test/test_config.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/teuthology/config.py b/teuthology/config.py index bcc9a8da81..9ccd024e0e 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -205,6 +205,9 @@ class FakeNamespace(YamlConfig): def __repr__(self): return repr(self._conf) + def __str__(self): + return str(self._conf) + def _get_config_path(): system_config_path = '/etc/teuthology.yaml' diff --git a/teuthology/test/test_config.py b/teuthology/test/test_config.py index 7ceb5cadd5..1bea8b0d75 100644 --- a/teuthology/test/test_config.py +++ b/teuthology/test/test_config.py @@ -149,3 +149,8 @@ class TestFakeNamespace(TestYamlConfig): del conf_obj.foo with pytest.raises(AttributeError): conf_obj.foo + + def test_to_str(self): + in_str = "foo: bar" + conf_obj = self.test_class.from_str(in_str) + assert conf_obj.to_str() == "{'foo': 'bar'}" -- 2.39.5