From f0a2e9791adbce2df17b57126ee5dde553205945 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Wed, 14 Jun 2017 13:33:45 +0800 Subject: [PATCH] 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 --- ironic_lib/tests/test_metrics_utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ironic_lib/tests/test_metrics_utils.py b/ironic_lib/tests/test_metrics_utils.py index 23b02f76..c1657b98 100644 --- a/ironic_lib/tests/test_metrics_utils.py +++ b/ironic_lib/tests/test_metrics_utils.py @@ -40,12 +40,8 @@ class TestGetLogger(base.IronicLibTestCase): CONF.clear_override('backend', group='metrics') def test_nonexisting_backend(self): - CONF.set_override('backend', 'none', group='metrics', - enforce_type=False) - self.assertRaises(exception.InvalidMetricConfig, - metrics_utils.get_metrics_logger, 'foo') - CONF.clear_override('backend', group='metrics') + metrics_utils.get_metrics_logger, 'foo', 'test') def test_numeric_prefix(self): self.assertRaises(exception.InvalidMetricConfig,