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
This commit is contained in:
Chris Dent 2015-08-07 18:52:12 +00:00
parent 4793854931
commit 59d1a602da

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock import mock
from oslo_config import fixture as config_fixture
from oslotest import base from oslotest import base
from requests import auth as req_auth from requests import auth as req_auth
import six import six
@ -20,6 +21,7 @@ from six.moves.urllib import parse as urlparse
from ceilometer.i18n import _ from ceilometer.i18n import _
from ceilometer.network.statistics.opendaylight import client from ceilometer.network.statistics.opendaylight import client
from ceilometer import service as ceilometer_service
class TestClientHTTPBasicAuth(base.BaseTestCase): class TestClientHTTPBasicAuth(base.BaseTestCase):
@ -29,6 +31,8 @@ class TestClientHTTPBasicAuth(base.BaseTestCase):
def setUp(self): def setUp(self):
super(TestClientHTTPBasicAuth, self).setUp() super(TestClientHTTPBasicAuth, self).setUp()
self.conf = self.useFixture(config_fixture.Config())
ceilometer_service.prepare_service([])
self.parsed_url = urlparse.urlparse( self.parsed_url = urlparse.urlparse(
'http://127.0.0.1:8080/controller/nb/v2?container_name=default&' 'http://127.0.0.1:8080/controller/nb/v2?container_name=default&'
'container_name=egg&auth=%s&user=admin&password=admin_pass&' 'container_name=egg&auth=%s&user=admin&password=admin_pass&'