Move test base into tests directory
The masakari.test module is used only by unit tests. Move it to the test code directory so that users can more easily determine that the file is used only in testing. Also make sure that the test codes are omitted in coverage report, because we do not care coverage of test code. Change-Id: I2ffc75bd2efacf4a18f546700af05abb7368fdd3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[run]
|
||||
branch = True
|
||||
source = masakari
|
||||
omit = masakari/openstack/*
|
||||
omit = masakari/tests/*
|
||||
|
||||
[report]
|
||||
ignore_errors = True
|
||||
|
@@ -15,8 +15,8 @@ from unittest import mock
|
||||
|
||||
from masakari.api.openstack.ha import extension_info
|
||||
from masakari import policy
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class fake_extension(object):
|
||||
@@ -44,7 +44,7 @@ def fake_policy_authorize_selective(context, action, target):
|
||||
return action != 'os_masakari_api:ext1-alias:discoverable'
|
||||
|
||||
|
||||
class ExtensionInfoTest(test.NoDBTestCase):
|
||||
class ExtensionInfoTest(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ExtensionInfoTest, self).setUp()
|
||||
|
@@ -28,8 +28,8 @@ from masakari.ha import api as ha_api
|
||||
from masakari.objects import base as obj_base
|
||||
from masakari.objects import host as host_obj
|
||||
from masakari.objects import segment as segment_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes as fakes_data
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -44,7 +44,7 @@ def _make_hosts_list(hosts_list):
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class HostTestCase(test.TestCase):
|
||||
class HostTestCase(base.TestCase):
|
||||
"""Test Case for host api."""
|
||||
|
||||
bad_request = exception.ValidationError
|
||||
@@ -486,7 +486,7 @@ class HostTestCase(test.TestCase):
|
||||
uuidsentinel.fake_host_3)
|
||||
|
||||
|
||||
class HostTestCasePolicyNotAuthorized(test.NoDBTestCase):
|
||||
class HostTestCasePolicyNotAuthorized(base.NoDBTestCase):
|
||||
"""Test Case for host non admin."""
|
||||
|
||||
def _set_up(self):
|
||||
|
@@ -31,8 +31,8 @@ from masakari.ha import api as ha_api
|
||||
from masakari.objects import base as obj_base
|
||||
from masakari.objects import fields
|
||||
from masakari.objects import notification as notification_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit.objects import test_objects
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -110,7 +110,7 @@ NOTIFICATION_LIST = _make_notifications_list(NOTIFICATION_LIST)
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class NotificationTestCase(test.TestCase):
|
||||
class NotificationTestCase(base.TestCase):
|
||||
"""Test Case for notifications api."""
|
||||
|
||||
bad_request = exception.ValidationError
|
||||
@@ -433,7 +433,7 @@ class NotificationTestCase(test.TestCase):
|
||||
self.assertEqual(HTTPStatus.METHOD_NOT_ALLOWED, resp.status_code)
|
||||
|
||||
|
||||
class NotificationCasePolicyNotAuthorized(test.NoDBTestCase):
|
||||
class NotificationCasePolicyNotAuthorized(base.NoDBTestCase):
|
||||
"""Test Case for notifications non admin."""
|
||||
|
||||
@mock.patch.object(engine_rpcapi, 'EngineAPI')
|
||||
|
@@ -25,8 +25,8 @@ from webob import exc
|
||||
from masakari.api.openstack.ha import segments
|
||||
from masakari import exception
|
||||
from masakari.objects import segment as segment_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ FAILOVER_SEGMENT = _make_segment_obj(FAILOVER_SEGMENT)
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class FailoverSegmentTestCase(test.TestCase):
|
||||
class FailoverSegmentTestCase(base.TestCase):
|
||||
"""Test Case for failover segment api."""
|
||||
|
||||
bad_request = exception.ValidationError
|
||||
@@ -410,7 +410,7 @@ class FailoverSegmentTestCase(test.TestCase):
|
||||
self.assertEqual(HTTPStatus.NO_CONTENT, resp.status_code)
|
||||
|
||||
|
||||
class FailoverSegmentTestCasePolicyNotAuthorized(test.NoDBTestCase):
|
||||
class FailoverSegmentTestCasePolicyNotAuthorized(base.NoDBTestCase):
|
||||
"""Test Case for failover segment non admin."""
|
||||
|
||||
def setUp(self):
|
||||
|
@@ -22,8 +22,8 @@ import webob
|
||||
|
||||
from masakari.api import api_version_request as avr
|
||||
from masakari.api.openstack.ha.views import versions
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
NS = {
|
||||
@@ -93,7 +93,7 @@ def _get_self_href(response):
|
||||
return ''
|
||||
|
||||
|
||||
class VersionsViewBuilderTests(test.NoDBTestCase):
|
||||
class VersionsViewBuilderTests(base.NoDBTestCase):
|
||||
def test_view_builder(self):
|
||||
base_url = "http://example.org/"
|
||||
|
||||
@@ -203,7 +203,7 @@ class VersionsViewBuilderTests(test.NoDBTestCase):
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
|
||||
class VersionsTest(test.NoDBTestCase):
|
||||
class VersionsTest(base.NoDBTestCase):
|
||||
exp_versions = copy.deepcopy(EXP_VERSIONS)
|
||||
exp_versions['v1.0']['links'].insert(0, {
|
||||
'href': 'http://localhost/v1/', 'rel': 'self'},
|
||||
|
@@ -25,8 +25,8 @@ from masakari.ha import api as ha_api
|
||||
from masakari.objects import base as obj_base
|
||||
from masakari.objects import notification as notification_obj
|
||||
from masakari.objects import vmove as vmove_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes as fakes_data
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -41,7 +41,7 @@ def _make_vmoves_list(vmove_list):
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class VMoveTestCase(test.TestCase):
|
||||
class VMoveTestCase(base.TestCase):
|
||||
"""Test Case for vmove api."""
|
||||
|
||||
bad_request = exception.ValidationError
|
||||
@@ -168,7 +168,7 @@ class VMoveTestCase(test.TestCase):
|
||||
uuidsentinel.fake_notification1, "2")
|
||||
|
||||
|
||||
class VMoveTestCasePolicyNotAuthorized(test.NoDBTestCase):
|
||||
class VMoveTestCasePolicyNotAuthorized(base.NoDBTestCase):
|
||||
"""Test Case for vmove non admin."""
|
||||
|
||||
def _set_up(self):
|
||||
|
@@ -23,12 +23,12 @@ from unittest import mock
|
||||
import webob
|
||||
|
||||
from masakari.api.openstack import common
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
|
||||
class MiscFunctionsTest(test.TestCase):
|
||||
class MiscFunctionsTest(base.TestCase):
|
||||
|
||||
def test_remove_trailing_version_from_href(self):
|
||||
fixture = 'http://www.testsite.com/v1.1'
|
||||
@@ -67,7 +67,7 @@ class MiscFunctionsTest(test.TestCase):
|
||||
fixture)
|
||||
|
||||
|
||||
class TestCollectionLinks(test.NoDBTestCase):
|
||||
class TestCollectionLinks(base.NoDBTestCase):
|
||||
"""Tests the _get_collection_links method."""
|
||||
|
||||
@mock.patch('masakari.api.openstack.common.ViewBuilder._get_next_link')
|
||||
@@ -143,7 +143,7 @@ class TestCollectionLinks(test.NoDBTestCase):
|
||||
self.assertThat(results, matchers.HasLength(1))
|
||||
|
||||
|
||||
class LinkPrefixTest(test.NoDBTestCase):
|
||||
class LinkPrefixTest(base.NoDBTestCase):
|
||||
|
||||
def test_update_link_prefix(self):
|
||||
vb = common.ViewBuilder()
|
||||
@@ -162,7 +162,7 @@ class LinkPrefixTest(test.NoDBTestCase):
|
||||
result)
|
||||
|
||||
|
||||
class UrlJoinTest(test.NoDBTestCase):
|
||||
class UrlJoinTest(base.NoDBTestCase):
|
||||
def test_url_join(self):
|
||||
pieces = ["one", "two", "three"]
|
||||
joined = common.url_join(*pieces)
|
||||
@@ -194,7 +194,7 @@ class UrlJoinTest(test.NoDBTestCase):
|
||||
self.assertEqual("", joined)
|
||||
|
||||
|
||||
class ViewBuilderLinkTest(test.NoDBTestCase):
|
||||
class ViewBuilderLinkTest(base.NoDBTestCase):
|
||||
project_id = uuidsentinel.fake_project_id
|
||||
api_version = "1.0"
|
||||
|
||||
@@ -240,7 +240,7 @@ class ViewBuilderLinkTest(test.NoDBTestCase):
|
||||
self.assertEqual(expected, bookmark_link)
|
||||
|
||||
|
||||
class PaginationParamsTest(test.NoDBTestCase):
|
||||
class PaginationParamsTest(base.NoDBTestCase):
|
||||
"""Unit tests for the `masakari.api.openstack.common.get_pagination_params`
|
||||
method which takes in a request object and returns 'marker' and 'limit'
|
||||
GET params.
|
||||
@@ -295,7 +295,7 @@ class PaginationParamsTest(test.NoDBTestCase):
|
||||
{'page_size': 5, 'limit': 20})
|
||||
|
||||
|
||||
class SortParamTest(test.NoDBTestCase):
|
||||
class SortParamTest(base.NoDBTestCase):
|
||||
|
||||
def test_get_sort_params_defaults(self):
|
||||
# Verifies the default sort key and direction.
|
||||
|
@@ -23,7 +23,7 @@ from masakari.api.openstack import extensions
|
||||
from masakari.api.openstack import ha
|
||||
from masakari.api.openstack.ha import extension_info
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -33,7 +33,7 @@ class fake_bad_extension(object):
|
||||
alias = "fake-bad"
|
||||
|
||||
|
||||
class ExtensionLoadingTestCase(test.NoDBTestCase):
|
||||
class ExtensionLoadingTestCase(base.NoDBTestCase):
|
||||
|
||||
@mock.patch('masakari.rpc.get_client')
|
||||
def test_extensions_loaded(self, mock_get_client):
|
||||
|
@@ -27,11 +27,11 @@ from masakari.api.openstack import extensions
|
||||
from masakari.api.openstack import wsgi
|
||||
from masakari.api import versioned_method
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class MicroversionedTest(testscenarios.WithScenarios, test.NoDBTestCase):
|
||||
class MicroversionedTest(testscenarios.WithScenarios, base.NoDBTestCase):
|
||||
|
||||
header_name = 'OpenStack-API-Version'
|
||||
|
||||
@@ -144,7 +144,7 @@ class RequestTest(MicroversionedTest):
|
||||
request.set_api_version_request)
|
||||
|
||||
|
||||
class ActionDispatcherTest(test.NoDBTestCase):
|
||||
class ActionDispatcherTest(base.NoDBTestCase):
|
||||
def test_dispatch(self):
|
||||
serializer = wsgi.ActionDispatcher()
|
||||
serializer.create = lambda x: 'pants'
|
||||
@@ -163,7 +163,7 @@ class ActionDispatcherTest(test.NoDBTestCase):
|
||||
self.assertEqual(serializer.dispatch({}, action='update'), 'trousers')
|
||||
|
||||
|
||||
class JSONDictSerializerTest(test.NoDBTestCase):
|
||||
class JSONDictSerializerTest(base.NoDBTestCase):
|
||||
def test_json(self):
|
||||
input_dict = dict(segments=dict(a=(2, 3)))
|
||||
expected_json = '{"segments":{"a":[2,3]}}'
|
||||
@@ -173,7 +173,7 @@ class JSONDictSerializerTest(test.NoDBTestCase):
|
||||
self.assertEqual(result, expected_json)
|
||||
|
||||
|
||||
class JSONDeserializerTest(test.NoDBTestCase):
|
||||
class JSONDeserializerTest(base.NoDBTestCase):
|
||||
def test_json(self):
|
||||
data = """{"a": {
|
||||
"a1": "1",
|
||||
@@ -920,7 +920,7 @@ class ResourceTest(MicroversionedTest):
|
||||
self.assertRaises(UnicodeDecodeError, req.get_response, app)
|
||||
|
||||
|
||||
class ResponseObjectTest(test.NoDBTestCase):
|
||||
class ResponseObjectTest(base.NoDBTestCase):
|
||||
def test_default_code(self):
|
||||
robj = wsgi.ResponseObject({})
|
||||
self.assertEqual(robj.code, HTTPStatus.OK)
|
||||
@@ -963,7 +963,7 @@ class ResponseObjectTest(test.NoDBTestCase):
|
||||
self.assertEqual(robj['hEADER'], 'foo')
|
||||
|
||||
|
||||
class ValidBodyTest(test.NoDBTestCase):
|
||||
class ValidBodyTest(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ValidBodyTest, self).setUp()
|
||||
@@ -992,7 +992,7 @@ class ValidBodyTest(test.NoDBTestCase):
|
||||
self.assertFalse(self.controller.is_valid_body(body, 'foo'))
|
||||
|
||||
|
||||
class TestController(test.NoDBTestCase):
|
||||
class TestController(base.NoDBTestCase):
|
||||
def test_check_for_versions_intersection_negative(self):
|
||||
func_list = [
|
||||
versioned_method.VersionedMethod('foo', (
|
||||
|
@@ -14,11 +14,11 @@
|
||||
|
||||
from masakari.api import api_version_request
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class APIVersionRequestTests(test.NoDBTestCase):
|
||||
class APIVersionRequestTests(base.NoDBTestCase):
|
||||
def test_valid_version_strings(self):
|
||||
def _test_string(version, exp_major, exp_minor):
|
||||
v = api_version_request.APIVersionRequest(version)
|
||||
|
@@ -20,12 +20,12 @@ import webob.exc
|
||||
|
||||
import masakari.api.auth
|
||||
import masakari.conf
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
CONF = masakari.conf.CONF
|
||||
|
||||
|
||||
class TestMasakariKeystoneContextMiddleware(test.NoDBTestCase):
|
||||
class TestMasakariKeystoneContextMiddleware(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestMasakariKeystoneContextMiddleware, self).setUp()
|
||||
@@ -80,7 +80,7 @@ class TestMasakariKeystoneContextMiddleware(test.NoDBTestCase):
|
||||
self.assertEqual(req_id, self.context.request_id)
|
||||
|
||||
|
||||
class TestNoAuthMiddleware(test.NoDBTestCase):
|
||||
class TestNoAuthMiddleware(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestNoAuthMiddleware, self).setUp()
|
||||
@@ -133,7 +133,7 @@ class TestNoAuthMiddleware(test.NoDBTestCase):
|
||||
self.assertEqual(req_id, self.context.request_id)
|
||||
|
||||
|
||||
class TestKeystoneMiddlewareRoles(test.NoDBTestCase):
|
||||
class TestKeystoneMiddlewareRoles(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestKeystoneMiddlewareRoles, self).setUp()
|
||||
@@ -166,7 +166,7 @@ class TestKeystoneMiddlewareRoles(test.NoDBTestCase):
|
||||
self.assertEqual(response.status, '200 Role Match')
|
||||
|
||||
|
||||
class TestPipeLineFactory(test.NoDBTestCase):
|
||||
class TestPipeLineFactory(base.NoDBTestCase):
|
||||
|
||||
class FakeFilter(object):
|
||||
def __init__(self, name):
|
||||
|
@@ -29,7 +29,7 @@ import testtools
|
||||
|
||||
from masakari.api import wsgi
|
||||
import masakari.exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import utils
|
||||
|
||||
SSL_CERT_DIR = os.path.normpath(os.path.join(
|
||||
@@ -38,7 +38,7 @@ SSL_CERT_DIR = os.path.normpath(os.path.join(
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class TestLoaderNothingExists(test.NoDBTestCase):
|
||||
class TestLoaderNothingExists(base.NoDBTestCase):
|
||||
"""Loader tests where os.path.exists always returns False."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -61,7 +61,7 @@ class TestLoaderNothingExists(test.NoDBTestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestLoaderNormalFilesystem(test.NoDBTestCase):
|
||||
class TestLoaderNormalFilesystem(base.NoDBTestCase):
|
||||
"""Loader tests with normal filesystem (unmodified os.path module)."""
|
||||
|
||||
_paste_config = """
|
||||
@@ -97,7 +97,7 @@ document_root = /tmp
|
||||
super(TestLoaderNormalFilesystem, self).tearDown()
|
||||
|
||||
|
||||
class TestWSGIServer(test.NoDBTestCase):
|
||||
class TestWSGIServer(base.NoDBTestCase):
|
||||
"""WSGI server tests."""
|
||||
|
||||
def test_no_app(self):
|
||||
|
@@ -16,11 +16,11 @@ from unittest import mock
|
||||
from masakari.cmd import api
|
||||
from masakari import config
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
@mock.patch.object(config, 'parse_args', new=lambda *args, **kwargs: None)
|
||||
class TestMasakariAPI(test.NoDBTestCase):
|
||||
class TestMasakariAPI(base.NoDBTestCase):
|
||||
|
||||
def test_continues_without_failure(self):
|
||||
|
||||
|
@@ -15,10 +15,10 @@
|
||||
from oslo_upgradecheck.upgradecheck import Code
|
||||
|
||||
from masakari.cmd import status
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class TestUpgradeChecks(test.TestCase):
|
||||
class TestUpgradeChecks(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestUpgradeChecks, self).setUp()
|
||||
|
@@ -21,11 +21,11 @@ from novaclient import exceptions as nova_exception
|
||||
from masakari.compute import nova
|
||||
from masakari import context
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
|
||||
class NovaClientTestCase(test.TestCase):
|
||||
class NovaClientTestCase(base.TestCase):
|
||||
def setUp(self):
|
||||
super(NovaClientTestCase, self).setUp()
|
||||
|
||||
@@ -145,7 +145,7 @@ class NovaClientTestCase(test.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class NovaApiTestCase(test.TestCase):
|
||||
class NovaApiTestCase(base.TestCase):
|
||||
def setUp(self):
|
||||
super(NovaApiTestCase, self).setUp()
|
||||
self.api = nova.API()
|
||||
|
@@ -17,7 +17,7 @@ from oslo_utils import timeutils
|
||||
from masakari import context
|
||||
from masakari import db
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
NOW = timeutils.utcnow().replace(microsecond=0)
|
||||
@@ -50,7 +50,7 @@ class ModelsObjectComparatorMixin(object):
|
||||
self.assertEqual(conv_and_sort(objs1), conv_and_sort(objs2))
|
||||
|
||||
|
||||
class FailoverSegmentsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
class FailoverSegmentsTestCase(base.TestCase, ModelsObjectComparatorMixin):
|
||||
|
||||
def setUp(self):
|
||||
super(FailoverSegmentsTestCase, self).setUp()
|
||||
@@ -187,7 +187,7 @@ class FailoverSegmentsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
{'name': 'test_1'})
|
||||
|
||||
|
||||
class HostsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
class HostsTestCase(base.TestCase, ModelsObjectComparatorMixin):
|
||||
|
||||
def setUp(self):
|
||||
super(HostsTestCase, self).setUp()
|
||||
@@ -386,7 +386,7 @@ class HostsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
self.ctxt, uuidsentinel.uuid_2, {'name': 'name_1'})
|
||||
|
||||
|
||||
class NotificationsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
class NotificationsTestCase(base.TestCase, ModelsObjectComparatorMixin):
|
||||
|
||||
def setUp(self):
|
||||
super(NotificationsTestCase, self).setUp()
|
||||
@@ -513,7 +513,7 @@ class NotificationsTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
context=self.ctxt, sort_keys=['invalid_sort_key'])
|
||||
|
||||
|
||||
class VMoveTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
||||
class VMoveTestCase(base.TestCase, ModelsObjectComparatorMixin):
|
||||
|
||||
def setUp(self):
|
||||
super(VMoveTestCase, self).setUp()
|
||||
|
@@ -25,10 +25,10 @@ from sqlalchemy.sql import func, select
|
||||
from masakari import context
|
||||
from masakari import db
|
||||
from masakari.db.sqlalchemy import api as db_api
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class PurgeDeletedTest(test.TestCase):
|
||||
class PurgeDeletedTest(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(PurgeDeletedTest, self).setUp()
|
||||
|
@@ -30,7 +30,7 @@ from masakari import exception
|
||||
from masakari import objects
|
||||
from masakari.objects import fields
|
||||
from masakari.objects import vmove as vmove_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes
|
||||
from masakari.tests import uuidsentinel as uuids
|
||||
|
||||
@@ -41,7 +41,7 @@ CONF = conf.CONF
|
||||
@mock.patch.object(nova.API, "enable_disable_service")
|
||||
@mock.patch.object(nova.API, "lock_server")
|
||||
@mock.patch.object(nova.API, "unlock_server")
|
||||
class HostFailureTestCase(test.TestCase):
|
||||
class HostFailureTestCase(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(HostFailureTestCase, self).setUp()
|
||||
|
@@ -23,11 +23,11 @@ from masakari.compute import nova
|
||||
from masakari import context
|
||||
from masakari.engine.drivers.taskflow import instance_failure
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes
|
||||
|
||||
|
||||
class InstanceFailureTestCase(test.TestCase):
|
||||
class InstanceFailureTestCase(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(InstanceFailureTestCase, self).setUp()
|
||||
|
@@ -24,13 +24,13 @@ from masakari import conf
|
||||
from masakari import context
|
||||
from masakari.engine.drivers.taskflow import process_failure
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes
|
||||
|
||||
CONF = conf.CONF
|
||||
|
||||
|
||||
class ProcessFailureTestCase(test.TestCase):
|
||||
class ProcessFailureTestCase(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ProcessFailureTestCase, self).setUp()
|
||||
|
@@ -25,7 +25,7 @@ from masakari.engine.drivers.taskflow import driver
|
||||
from masakari.engine.drivers.taskflow import host_failure
|
||||
from masakari import exception
|
||||
from masakari.objects import fields
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base as test_base
|
||||
from masakari.tests.unit import fakes
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -41,7 +41,7 @@ class FakeFlow(object):
|
||||
pass
|
||||
|
||||
|
||||
class TaskflowDriverTestCase(test.TestCase):
|
||||
class TaskflowDriverTestCase(test_base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TaskflowDriverTestCase, self).setUp()
|
||||
|
@@ -29,7 +29,7 @@ from masakari.objects import fields
|
||||
from masakari.objects import host as host_obj
|
||||
from masakari.objects import notification as notification_obj
|
||||
from masakari import rpc
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -52,7 +52,7 @@ def _get_vm_type_notification(status="new"):
|
||||
|
||||
|
||||
@mock.patch.object(notification_obj.Notification, "get_by_uuid")
|
||||
class EngineManagerUnitTestCase(test.NoDBTestCase):
|
||||
class EngineManagerUnitTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(EngineManagerUnitTestCase, self).setUp()
|
||||
rpc.init(CONF)
|
||||
|
@@ -23,11 +23,11 @@ from unittest import mock
|
||||
from masakari import context
|
||||
from masakari.engine import rpcapi as engine_rpcapi
|
||||
from masakari import objects
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit.engine import fake_engine
|
||||
|
||||
|
||||
class EngineRpcAPITestCase(test.TestCase):
|
||||
class EngineRpcAPITestCase(base.TestCase):
|
||||
def setUp(self):
|
||||
super(EngineRpcAPITestCase, self).setUp()
|
||||
self.context = context.RequestContext()
|
||||
|
@@ -33,8 +33,8 @@ from masakari.objects import host as host_obj
|
||||
from masakari.objects import notification as notification_obj
|
||||
from masakari.objects import segment as segment_obj
|
||||
from masakari.objects import vmove as vmove_obj
|
||||
from masakari import test
|
||||
from masakari.tests.unit.api.openstack import fakes
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fakes as fakes_data
|
||||
from masakari.tests import uuidsentinel
|
||||
|
||||
@@ -57,7 +57,7 @@ def _make_notification_obj(notification_dict):
|
||||
return notification_obj.Notification(**notification_dict)
|
||||
|
||||
|
||||
class FailoverSegmentAPITestCase(test.NoDBTestCase):
|
||||
class FailoverSegmentAPITestCase(base.NoDBTestCase):
|
||||
"""Test Case for failover segment api."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -286,7 +286,7 @@ class FailoverSegmentAPITestCase(test.NoDBTestCase):
|
||||
mock_notify_about_segment_api.assert_has_calls(notify_calls)
|
||||
|
||||
|
||||
class HostAPITestCase(test.NoDBTestCase):
|
||||
class HostAPITestCase(base.NoDBTestCase):
|
||||
"""Test Case for host api."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -695,7 +695,7 @@ class HostAPITestCase(test.NoDBTestCase):
|
||||
uuidsentinel.fake_host_1)
|
||||
|
||||
|
||||
class NotificationAPITestCase(test.NoDBTestCase):
|
||||
class NotificationAPITestCase(base.NoDBTestCase):
|
||||
"""Test Case for notification api."""
|
||||
|
||||
@mock.patch.object(engine_rpcapi, 'EngineAPI')
|
||||
@@ -945,7 +945,7 @@ class NotificationAPITestCase(test.NoDBTestCase):
|
||||
self.context, self.req)
|
||||
|
||||
|
||||
class VMoveAPITestCase(test.NoDBTestCase):
|
||||
class VMoveAPITestCase(base.NoDBTestCase):
|
||||
"""Test Case for vmove api."""
|
||||
|
||||
def setUp(self):
|
||||
|
@@ -22,10 +22,10 @@ from oslo_versionedobjects import fixture
|
||||
from masakari.notifications.objects import base as notification
|
||||
from masakari.objects import base
|
||||
from masakari.objects import fields
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base as test_base
|
||||
|
||||
|
||||
class TestNotificationBase(test.NoDBTestCase):
|
||||
class TestNotificationBase(test_base.NoDBTestCase):
|
||||
|
||||
@base.MasakariObjectRegistry.register_if(False)
|
||||
class TestObject(base.MasakariObject):
|
||||
@@ -245,7 +245,7 @@ class TestNotificationBase(test.NoDBTestCase):
|
||||
self.assertIn('test-update-2.json', self.TestNotification.samples)
|
||||
|
||||
|
||||
class TestNotificationObjectVersions(test.NoDBTestCase):
|
||||
class TestNotificationObjectVersions(test_base.NoDBTestCase):
|
||||
|
||||
def test_notification_payload_version_depends_on_the_schema(self):
|
||||
@base.MasakariObjectRegistry.register_if(False)
|
||||
|
@@ -19,7 +19,7 @@ import iso8601
|
||||
from oslo_versionedobjects import exception as ovo_exc
|
||||
|
||||
from masakari.objects import fields
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari import utils
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class FakeEnumAltField(fields.BaseEnumField):
|
||||
AUTO_TYPE = FakeEnumAlt()
|
||||
|
||||
|
||||
class TestField(test.NoDBTestCase):
|
||||
class TestField(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(TestField, self).setUp()
|
||||
self.field = fields.Field(FakeFieldType())
|
||||
|
@@ -27,7 +27,7 @@ from masakari import objects
|
||||
from masakari.objects import base
|
||||
from masakari.objects import fields
|
||||
from masakari.objects import segment
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base as test_base
|
||||
from masakari.tests.unit.objects import fake_args
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ class MyObj(base.MasakariPersistentObject, base.MasakariObject,
|
||||
primitive['bar'] = 'old%s' % primitive['bar']
|
||||
|
||||
|
||||
class TestObjMakeList(test.NoDBTestCase):
|
||||
class TestObjMakeList(test_base.NoDBTestCase):
|
||||
|
||||
def test_obj_make_list(self):
|
||||
class MyList(base.ObjectListBase, base.MasakariObject):
|
||||
@@ -157,7 +157,7 @@ def compare_obj(test, obj, db_obj, subs=None, allow_missing=None,
|
||||
test.assertEqual(db_val, obj_val)
|
||||
|
||||
|
||||
class _BaseTestCase(test.TestCase):
|
||||
class _BaseTestCase(test_base.TestCase):
|
||||
def setUp(self):
|
||||
super(_BaseTestCase, self).setUp()
|
||||
self.user_id = 'fake-user'
|
||||
@@ -615,7 +615,7 @@ class TestObject(_LocalTest, _TestObject):
|
||||
self.assertTrue(obj.deleted)
|
||||
|
||||
|
||||
class TestRegistry(test.NoDBTestCase):
|
||||
class TestRegistry(test_base.NoDBTestCase):
|
||||
@mock.patch('masakari.objects.base.objects')
|
||||
def test_hook_chooses_newer_properly(self, mock_objects):
|
||||
del mock_objects.MyObj
|
||||
@@ -703,9 +703,9 @@ def get_masakari_objects():
|
||||
return masakari_classes
|
||||
|
||||
|
||||
class TestObjectVersions(test.NoDBTestCase, _BaseTestCase):
|
||||
class TestObjectVersions(test_base.NoDBTestCase, _BaseTestCase):
|
||||
def setUp(self):
|
||||
super(test.NoDBTestCase, self).setUp()
|
||||
super(test_base.NoDBTestCase, self).setUp()
|
||||
base.MasakariObjectRegistry.register_notification_objects()
|
||||
|
||||
def test_versions(self):
|
||||
@@ -716,7 +716,7 @@ class TestObjectVersions(test.NoDBTestCase, _BaseTestCase):
|
||||
if os.getenv('GENERATE_HASHES'):
|
||||
open('object_hashes.txt', 'w').write(
|
||||
pprint.pformat(fingerprints))
|
||||
raise test.TestingException(
|
||||
raise base.TestingException(
|
||||
'Generated hashes in object_hashes.txt')
|
||||
|
||||
expected, actual = checker.test_hashes(object_data)
|
||||
@@ -834,7 +834,7 @@ class TestObjEqualPrims(_BaseTestCase):
|
||||
"should be equal")
|
||||
|
||||
|
||||
class TestObjMethodOverrides(test.NoDBTestCase):
|
||||
class TestObjMethodOverrides(test_base.NoDBTestCase):
|
||||
def test_obj_reset_changes(self):
|
||||
args = inspect.getfullargspec(base.MasakariObject.obj_reset_changes)
|
||||
obj_classes = base.MasakariObjectRegistry.obj_classes()
|
||||
|
@@ -24,7 +24,7 @@ from masakari.api import validation
|
||||
from masakari.api.validation import parameter_types
|
||||
from masakari.api.validation import validators
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class FakeRequest(object):
|
||||
@@ -34,7 +34,7 @@ class FakeRequest(object):
|
||||
self.api_version_request = api_version.APIVersionRequest(version)
|
||||
|
||||
|
||||
class ValidationRegex(test.NoDBTestCase):
|
||||
class ValidationRegex(base.NoDBTestCase):
|
||||
|
||||
def test_build_regex_range(self):
|
||||
|
||||
@@ -80,7 +80,7 @@ class ValidationRegex(test.NoDBTestCase):
|
||||
re.escape('\x00') + '-' + re.escape('\x1f') + 'A-CZ')
|
||||
|
||||
|
||||
class APIValidationTestCase(test.NoDBTestCase):
|
||||
class APIValidationTestCase(base.NoDBTestCase):
|
||||
|
||||
def setUp(self, schema=None):
|
||||
super(APIValidationTestCase, self).setUp()
|
||||
@@ -112,7 +112,7 @@ class APIValidationTestCase(test.NoDBTestCase):
|
||||
self.fail('Any exception does not happen.')
|
||||
|
||||
|
||||
class FormatCheckerTestCase(test.NoDBTestCase):
|
||||
class FormatCheckerTestCase(base.NoDBTestCase):
|
||||
|
||||
def test_format_checker_failed(self):
|
||||
format_checker = validators.FormatChecker()
|
||||
|
@@ -19,10 +19,10 @@ import fixtures
|
||||
from oslo_config import cfg
|
||||
|
||||
import masakari.conf.api
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class ConfTest(test.NoDBTestCase):
|
||||
class ConfTest(base.NoDBTestCase):
|
||||
"""This is a test and pattern for parsing tricky options."""
|
||||
|
||||
class TestConfigOpts(cfg.ConfigOpts):
|
||||
|
@@ -16,10 +16,10 @@ from oslo_context import context as o_context
|
||||
from oslo_context import fixture as o_fixture
|
||||
|
||||
from masakari import context
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class ContextTestCase(test.NoDBTestCase):
|
||||
class ContextTestCase(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(ContextTestCase, self).setUp()
|
||||
|
@@ -20,10 +20,10 @@ import inspect
|
||||
from webob.util import status_reasons
|
||||
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class MasakariExceptionTestCase(test.NoDBTestCase):
|
||||
class MasakariExceptionTestCase(base.NoDBTestCase):
|
||||
def test_default_error_msg(self):
|
||||
class FakeMasakariException(exception.MasakariException):
|
||||
msg_fmt = "default message"
|
||||
@@ -96,7 +96,7 @@ class MasakariExceptionTestCase(test.NoDBTestCase):
|
||||
self.assertEqual("some message %(somearg)s", exc.format_message())
|
||||
|
||||
|
||||
class ConvertedExceptionTestCase(test.NoDBTestCase):
|
||||
class ConvertedExceptionTestCase(base.NoDBTestCase):
|
||||
def test_instantiate(self):
|
||||
exc = exception.ConvertedException(int(HTTPStatus.BAD_REQUEST),
|
||||
'Bad Request', 'reason')
|
||||
@@ -118,7 +118,7 @@ class ConvertedExceptionTestCase(test.NoDBTestCase):
|
||||
self.assertRaises(KeyError, exception.ConvertedException, 10)
|
||||
|
||||
|
||||
class ExceptionTestCase(test.NoDBTestCase):
|
||||
class ExceptionTestCase(base.NoDBTestCase):
|
||||
@staticmethod
|
||||
def _raise_exc(exc):
|
||||
raise exc(int(HTTPStatus.INTERNAL_SERVER_ERROR))
|
||||
@@ -135,7 +135,7 @@ class ExceptionTestCase(test.NoDBTestCase):
|
||||
self.assertRaises(exc, self._raise_exc, exc)
|
||||
|
||||
|
||||
class ExceptionValidMessageTestCase(test.NoDBTestCase):
|
||||
class ExceptionValidMessageTestCase(base.NoDBTestCase):
|
||||
|
||||
def test_messages(self):
|
||||
failures = []
|
||||
|
@@ -19,11 +19,11 @@ import ddt
|
||||
import pycodestyle
|
||||
|
||||
from masakari.hacking import checks
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
@ddt.ddt
|
||||
class HackingTestCase(test.NoDBTestCase):
|
||||
class HackingTestCase(base.NoDBTestCase):
|
||||
"""This class tests the hacking checks in masakari.hacking.checks by
|
||||
passing strings to the check methods like the pycodestyle/flake8 parser
|
||||
would.
|
||||
@@ -278,7 +278,7 @@ class HackingTestCase(test.NoDBTestCase):
|
||||
|
||||
def test_check_contextlib_use(self):
|
||||
code = """
|
||||
with test.nested(
|
||||
with base.nested(
|
||||
mock.patch.object(network_model.NetworkInfo, 'hydrate'),
|
||||
mock.patch.object(objects.InstanceInfoCache, 'save'),
|
||||
) as (
|
||||
|
@@ -18,10 +18,10 @@ from unittest import mock
|
||||
from masakari.cmd import manage
|
||||
from masakari import context
|
||||
from masakari.db import api as db_api
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class DBCommandsTestCase(test.TestCase):
|
||||
class DBCommandsTestCase(base.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(DBCommandsTestCase, self).setUp()
|
||||
|
@@ -25,7 +25,7 @@ import masakari.conf
|
||||
from masakari import context
|
||||
from masakari import exception
|
||||
from masakari import policy
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari.tests.unit import fake_policy
|
||||
from masakari.tests.unit import policy_fixture
|
||||
from masakari import utils
|
||||
@@ -33,7 +33,7 @@ from masakari import utils
|
||||
CONF = masakari.conf.CONF
|
||||
|
||||
|
||||
class PolicyFileTestCase(test.NoDBTestCase):
|
||||
class PolicyFileTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(PolicyFileTestCase, self).setUp()
|
||||
self.context = context.RequestContext('fake', 'fake')
|
||||
@@ -64,7 +64,7 @@ class PolicyFileTestCase(test.NoDBTestCase):
|
||||
self.context, action, self.target)
|
||||
|
||||
|
||||
class PolicyTestCase(test.NoDBTestCase):
|
||||
class PolicyTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(PolicyTestCase, self).setUp()
|
||||
rules = [
|
||||
@@ -155,7 +155,7 @@ class PolicyTestCase(test.NoDBTestCase):
|
||||
policy.authorize(admin_context, uppercase_action, self.target)
|
||||
|
||||
|
||||
class IsAdminCheckTestCase(test.NoDBTestCase):
|
||||
class IsAdminCheckTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(IsAdminCheckTestCase, self).setUp()
|
||||
policy.init(suppress_deprecation_warnings=True)
|
||||
@@ -191,7 +191,7 @@ class IsAdminCheckTestCase(test.NoDBTestCase):
|
||||
policy._ENFORCER), True)
|
||||
|
||||
|
||||
class AdminRolePolicyTestCase(test.NoDBTestCase):
|
||||
class AdminRolePolicyTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(AdminRolePolicyTestCase, self).setUp()
|
||||
self.policy = self.useFixture(policy_fixture.RoleBasedPolicyFixture())
|
||||
@@ -208,7 +208,7 @@ class AdminRolePolicyTestCase(test.NoDBTestCase):
|
||||
self.context, action, self.target)
|
||||
|
||||
|
||||
class RealRolePolicyTestCase(test.NoDBTestCase):
|
||||
class RealRolePolicyTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(RealRolePolicyTestCase, self).setUp()
|
||||
self.policy = self.useFixture(policy_fixture.RealPolicyFixture())
|
||||
|
@@ -23,7 +23,7 @@ import testtools
|
||||
|
||||
from masakari import context
|
||||
from masakari import rpc
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class FakeAPI(rpc.RPCAPI):
|
||||
@@ -32,7 +32,7 @@ class FakeAPI(rpc.RPCAPI):
|
||||
BINARY = 'masakari-engine'
|
||||
|
||||
|
||||
class RPCAPITestCase(test.TestCase):
|
||||
class RPCAPITestCase(base.TestCase):
|
||||
"""Tests RPCAPI mixin aggregating stuff related to RPC compatibility."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -245,7 +245,7 @@ class TestRPC(testtools.TestCase):
|
||||
"the versioned notifiers properly.")
|
||||
|
||||
|
||||
class TestJsonPayloadSerializer(test.NoDBTestCase):
|
||||
class TestJsonPayloadSerializer(base.NoDBTestCase):
|
||||
def test_serialize_entity(self):
|
||||
with mock.patch.object(jsonutils, 'to_primitive') as mock_prim:
|
||||
rpc.JsonPayloadSerializer.serialize_entity('context', 'entity')
|
||||
@@ -253,7 +253,7 @@ class TestJsonPayloadSerializer(test.NoDBTestCase):
|
||||
mock_prim.assert_called_once_with('entity', convert_instances=True)
|
||||
|
||||
|
||||
class TestRequestContextSerializer(test.NoDBTestCase):
|
||||
class TestRequestContextSerializer(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(TestRequestContextSerializer, self).setUp()
|
||||
self.mock_base = mock.Mock()
|
||||
|
@@ -15,10 +15,10 @@
|
||||
import functools
|
||||
|
||||
from masakari import safe_utils
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
|
||||
class WrappedCodeTestCase(test.NoDBTestCase):
|
||||
class WrappedCodeTestCase(base.NoDBTestCase):
|
||||
"""Test the get_wrapped_function utility method."""
|
||||
|
||||
def _wrapper(self, function):
|
||||
|
@@ -27,7 +27,7 @@ from masakari import exception
|
||||
from masakari import manager
|
||||
from masakari import rpc
|
||||
from masakari import service
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -38,7 +38,7 @@ class FakeManager(manager.Manager):
|
||||
return 'manager'
|
||||
|
||||
|
||||
class ServiceManagerTestCase(test.NoDBTestCase):
|
||||
class ServiceManagerTestCase(base.NoDBTestCase):
|
||||
"""Test cases for Services."""
|
||||
|
||||
@mock.patch.object(rpc, 'init')
|
||||
@@ -50,7 +50,7 @@ class ServiceManagerTestCase(test.NoDBTestCase):
|
||||
self.assertEqual('manager', serv.test_method())
|
||||
|
||||
|
||||
class ServiceTestCase(test.NoDBTestCase):
|
||||
class ServiceTestCase(base.NoDBTestCase):
|
||||
"""Test cases for Services."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -112,7 +112,7 @@ class ServiceTestCase(test.NoDBTestCase):
|
||||
mock_reset.assert_called_once_with()
|
||||
|
||||
|
||||
class TestWSGIService(test.NoDBTestCase):
|
||||
class TestWSGIService(base.NoDBTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestWSGIService, self).setUp()
|
||||
@@ -153,7 +153,7 @@ class TestWSGIService(test.NoDBTestCase):
|
||||
CONF.wsgi.default_pool_size)
|
||||
|
||||
|
||||
class TestLauncher(test.NoDBTestCase):
|
||||
class TestLauncher(base.NoDBTestCase):
|
||||
|
||||
@mock.patch.object(_service, 'launch')
|
||||
def test_launch_app(self, mock_launch):
|
||||
|
@@ -23,13 +23,13 @@ from oslo_context import fixture as context_fixture
|
||||
import masakari
|
||||
from masakari import context
|
||||
from masakari import exception
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari import utils
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class UTF8TestCase(test.NoDBTestCase):
|
||||
class UTF8TestCase(base.NoDBTestCase):
|
||||
def test_none_value(self):
|
||||
self.assertIsInstance(utils.utf8(None), type(None))
|
||||
|
||||
@@ -50,7 +50,7 @@ class UTF8TestCase(test.NoDBTestCase):
|
||||
self.assertEqual(some_value, utils.utf8(some_value).decode("utf-8"))
|
||||
|
||||
|
||||
class MonkeyPatchTestCase(test.NoDBTestCase):
|
||||
class MonkeyPatchTestCase(base.NoDBTestCase):
|
||||
"""Unit test for utils.monkey_patch()."""
|
||||
def setUp(self):
|
||||
super(MonkeyPatchTestCase, self).setUp()
|
||||
@@ -95,7 +95,7 @@ class MonkeyPatchTestCase(test.NoDBTestCase):
|
||||
masakari.tests.unit.monkey_patch_example.CALLED_FUNCTION))
|
||||
|
||||
|
||||
class MonkeyPatchDefaultTestCase(test.NoDBTestCase):
|
||||
class MonkeyPatchDefaultTestCase(base.NoDBTestCase):
|
||||
"""Unit test for default monkey_patch_modules value."""
|
||||
|
||||
def setUp(self):
|
||||
@@ -118,7 +118,7 @@ class MonkeyPatchDefaultTestCase(test.NoDBTestCase):
|
||||
getattr(decorator_module, decorator_name[1])
|
||||
|
||||
|
||||
class ExpectedArgsTestCase(test.NoDBTestCase):
|
||||
class ExpectedArgsTestCase(base.NoDBTestCase):
|
||||
def test_passes(self):
|
||||
@utils.expects_func_args('foo', 'baz')
|
||||
def dec(f):
|
||||
@@ -170,7 +170,7 @@ class ExpectedArgsTestCase(test.NoDBTestCase):
|
||||
self.assertRaises(TypeError, dec, func)
|
||||
|
||||
|
||||
class SpawnNTestCase(test.NoDBTestCase):
|
||||
class SpawnNTestCase(base.NoDBTestCase):
|
||||
def setUp(self):
|
||||
super(SpawnNTestCase, self).setUp()
|
||||
self.useFixture(context_fixture.ClearRequestContext())
|
||||
@@ -235,7 +235,7 @@ class SpawnTestCase(SpawnNTestCase):
|
||||
self.spawn_name = 'spawn'
|
||||
|
||||
|
||||
class ValidateIntegerTestCase(test.NoDBTestCase):
|
||||
class ValidateIntegerTestCase(base.NoDBTestCase):
|
||||
def test_exception_converted(self):
|
||||
self.assertRaises(exception.InvalidInput,
|
||||
utils.validate_integer,
|
||||
|
@@ -17,11 +17,11 @@ import builtins
|
||||
import io
|
||||
from oslo_config import cfg
|
||||
|
||||
from masakari import test
|
||||
from masakari.tests.unit import base
|
||||
from masakari import version
|
||||
|
||||
|
||||
class VersionTestCase(test.NoDBTestCase):
|
||||
class VersionTestCase(base.NoDBTestCase):
|
||||
"""Test cases for Versions code."""
|
||||
|
||||
def test_version_string_with_package_is_good(self):
|
||||
|
Reference in New Issue
Block a user