Edit unit test base class inheritance

Editing the inheritance within our unit test base classes will
simplify reusing certain methods from the classes and will
indirectly fix TypeError: unbound method issue we face now in
RDO where python-tempestconf is packaged.

Change-Id: Iaa11400caaaef3f5185491229dac0b32f358d9af
changes/85/744685/1 3.0.1
Martin Kopec 2 years ago
parent cf00bfa46b
commit d23c744b31
  1. 2
      config_tempest/tests/base.py
  2. 13
      config_tempest/tests/services/test_octavia.py

@ -103,7 +103,7 @@ class BaseConfigTempestTest(base.BaseTestCase):
return ClientManager(conf, creds)
class BaseServiceTest(base.BaseTestCase):
class BaseServiceTest(BaseConfigTempestTest):
"""Test case base class for all api_discovery unit tests"""
FAKE_TOKEN = "s6d5f45sdf4s564f4s6464sdfsd514"

@ -16,25 +16,24 @@
from unittest import mock
from config_tempest.services.octavia import LoadBalancerService
from config_tempest.tests.base import BaseConfigTempestTest
from config_tempest.tests.base import BaseServiceTest as bst
from config_tempest.tests.base import BaseServiceTest
class TestOctaviaService(BaseConfigTempestTest):
class TestOctaviaService(BaseServiceTest):
def setUp(self):
super(TestOctaviaService, self).setUp()
self.conf = self._get_conf("v2", "v3")
self.clients = self._get_clients(self.conf)
self.Service = LoadBalancerService("ServiceName",
"ServiceType",
bst.FAKE_URL + "v2.0/",
bst.FAKE_TOKEN,
self.FAKE_URL + "v2.0/",
self.FAKE_TOKEN,
disable_ssl_validation=False)
self.Service.client = bst.FakeServiceClient(
self.Service.client = self.FakeServiceClient(
services={"services": [{"name": "octavia", "enabled": True}]}
)
self.conf.set("identity", "region", "regionOne")
bst._fake_service_do_get_method(self, bst.FAKE_LBAAS_PROVIDERS)
self._fake_service_do_get_method(self.FAKE_LBAAS_PROVIDERS)
def test_list_drivers(self):
expected_resp = [

Loading…
Cancel
Save