From 59d1a602da4908f4f55dc22a4826f9d01d5e5b78 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Fri, 7 Aug 2015 18:52:12 +0000 Subject: [PATCH] Correctly intialized olso config fixture for TestClientHTTPBasicAuth Otherwise it can fail intermittently when run with other tests or consistently when run in isolation. Change-Id: Ib0674c93c8e41ab610fb799470a99fa427dfd14f Closes-Bug: #1482740 --- .../tests/unit/network/statistics/opendaylight/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ceilometer/tests/unit/network/statistics/opendaylight/test_client.py b/ceilometer/tests/unit/network/statistics/opendaylight/test_client.py index 9af8b012..5fa1f26d 100644 --- a/ceilometer/tests/unit/network/statistics/opendaylight/test_client.py +++ b/ceilometer/tests/unit/network/statistics/opendaylight/test_client.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. import mock +from oslo_config import fixture as config_fixture from oslotest import base from requests import auth as req_auth import six @@ -20,6 +21,7 @@ from six.moves.urllib import parse as urlparse from ceilometer.i18n import _ from ceilometer.network.statistics.opendaylight import client +from ceilometer import service as ceilometer_service class TestClientHTTPBasicAuth(base.BaseTestCase): @@ -29,6 +31,8 @@ class TestClientHTTPBasicAuth(base.BaseTestCase): def setUp(self): super(TestClientHTTPBasicAuth, self).setUp() + self.conf = self.useFixture(config_fixture.Config()) + ceilometer_service.prepare_service([]) self.parsed_url = urlparse.urlparse( 'http://127.0.0.1:8080/controller/nb/v2?container_name=default&' 'container_name=egg&auth=%s&user=admin&password=admin_pass&'