summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-10 20:42:18 +0000
committerGerrit Code Review <review@openstack.org>2018-08-10 20:42:18 +0000
commit33e9c5d46b2abc6a1828bc91ebeceac685deb8df (patch)
tree77ea3e2ff611e5f349a9cdb5dde32a13373587f3
parent381f9f15e348959226d4e111477a9df64915782e (diff)
parent98c0d2c1db7bbcb30b5bfe4f347bdb2124de25a5 (diff)
Merge "Update unit test to reflect latest oslo.config"
-rw-r--r--oslo_reports/tests/test_openstack_generators.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/oslo_reports/tests/test_openstack_generators.py b/oslo_reports/tests/test_openstack_generators.py
index f5b1cda..b2ddab8 100644
--- a/oslo_reports/tests/test_openstack_generators.py
+++ b/oslo_reports/tests/test_openstack_generators.py
@@ -94,6 +94,16 @@ class TestOpenstackGenerators(base.BaseTestCase):
94 model = os_cgen.ConfigReportGenerator(conf)() 94 model = os_cgen.ConfigReportGenerator(conf)()
95 model.set_current_view_type('text') 95 model.set_current_view_type('text')
96 96
97 # oslo.config added a default config_source opt which gets included
98 # in our output, but we also need to support older versions where that
99 # wasn't the case. This logic can be removed once the oslo.config
100 # lower constraint becomes >=6.4.0.
101 config_source_line = ' config_source = \n'
102 try:
103 conf.config_source
104 except cfg.NoSuchOptError:
105 config_source_line = ''
106
97 target_str = ('\ncheese: \n' 107 target_str = ('\ncheese: \n'
98 ' from_cow = True\n' 108 ' from_cow = True\n'
99 ' group_secrets = ***\n' 109 ' group_secrets = ***\n'
@@ -101,8 +111,9 @@ class TestOpenstackGenerators(base.BaseTestCase):
101 ' sharpness = 1\n' 111 ' sharpness = 1\n'
102 '\n' 112 '\n'
103 'default: \n' 113 'default: \n'
114 '%s'
104 ' crackers = triscuit\n' 115 ' crackers = triscuit\n'
105 ' secrets = ***') 116 ' secrets = ***') % config_source_line
106 self.assertEqual(target_str, six.text_type(model)) 117 self.assertEqual(target_str, six.text_type(model))
107 118
108 def test_package_report_generator(self): 119 def test_package_report_generator(self):