Adjust test with option 'backend'

Config option 'backend' with parameter choices =['noop', 'statsd'],
that means oslo.config will ensure value is one of them, otherwise
a ValueError will be raised, so don't need handle and test config
option 'backend' with invalid value.

Change-Id: Ibda809416c565d57f19179d7f13f4cee8f8145ff
This commit is contained in:
ChangBo Guo(gcb) 2017-06-14 13:33:45 +08:00
parent 2c62a340f8
commit f0a2e9791a

View File

@ -40,12 +40,8 @@ class TestGetLogger(base.IronicLibTestCase):
CONF.clear_override('backend', group='metrics') CONF.clear_override('backend', group='metrics')
def test_nonexisting_backend(self): def test_nonexisting_backend(self):
CONF.set_override('backend', 'none', group='metrics',
enforce_type=False)
self.assertRaises(exception.InvalidMetricConfig, self.assertRaises(exception.InvalidMetricConfig,
metrics_utils.get_metrics_logger, 'foo') metrics_utils.get_metrics_logger, 'foo', 'test')
CONF.clear_override('backend', group='metrics')
def test_numeric_prefix(self): def test_numeric_prefix(self):
self.assertRaises(exception.InvalidMetricConfig, self.assertRaises(exception.InvalidMetricConfig,