diff --git a/designate/tests/test_api/__init__.py b/designate/tests/test_api/__init__.py index bf9cc4d7f..e69de29bb 100644 --- a/designate/tests/test_api/__init__.py +++ b/designate/tests/test_api/__init__.py @@ -1,20 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from designate.tests import TestCase - - -class ApiTestCase(TestCase): - pass diff --git a/designate/tests/test_api/test_admin/__init__.py b/designate/tests/test_api/test_admin/__init__.py index 82bbec294..4ff894e41 100644 --- a/designate/tests/test_api/test_admin/__init__.py +++ b/designate/tests/test_api/test_admin/__init__.py @@ -20,7 +20,7 @@ from webtest import TestApp from designate.api import admin as admin_api from designate.api import middleware -from designate.tests.test_api import ApiTestCase +import designate.tests LOG = logging.getLogger(__name__) @@ -33,7 +33,7 @@ INVALID_ID = [ ] -class AdminApiTestCase(ApiTestCase): +class AdminApiTestCase(designate.tests.TestCase): def setUp(self): super(AdminApiTestCase, self).setUp() diff --git a/designate/tests/test_api/test_middleware.py b/designate/tests/test_api/test_middleware.py index ea1624963..6e6dd3f40 100644 --- a/designate/tests/test_api/test_middleware.py +++ b/designate/tests/test_api/test_middleware.py @@ -23,7 +23,7 @@ from designate.api import middleware from designate import context from designate import exceptions from designate import rpc -from designate.tests.test_api import ApiTestCase +import designate.tests class FakeRequest(object): @@ -43,7 +43,7 @@ class FakeRequest(object): return "FakeResponse" -class KeystoneContextMiddlewareTest(ApiTestCase): +class KeystoneContextMiddlewareTest(designate.tests.TestCase): def test_process_request(self): app = middleware.KeystoneContextMiddleware({}) @@ -106,7 +106,7 @@ class KeystoneContextMiddlewareTest(ApiTestCase): self.assertEqual(response, 'FakeResponse') -class NoAuthContextMiddlewareTest(ApiTestCase): +class NoAuthContextMiddlewareTest(designate.tests.TestCase): def test_process_request(self): app = middleware.NoAuthContextMiddleware({}) @@ -125,7 +125,7 @@ class NoAuthContextMiddlewareTest(ApiTestCase): self.assertEqual(['admin'], ctxt.roles) -class MaintenanceMiddlewareTest(ApiTestCase): +class MaintenanceMiddlewareTest(designate.tests.TestCase): def test_process_request_disabled(self): self.config(maintenance_mode=False, group='service:api') @@ -197,7 +197,7 @@ class MaintenanceMiddlewareTest(ApiTestCase): self.assertEqual('FakeResponse', response) -class NormalizeURIMiddlewareTest(ApiTestCase): +class NormalizeURIMiddlewareTest(designate.tests.TestCase): def test_strip_trailing_slases(self): request = FakeRequest() request.environ['PATH_INFO'] = 'resource/' @@ -223,7 +223,7 @@ class NormalizeURIMiddlewareTest(ApiTestCase): self.assertEqual('resource', request.environ['PATH_INFO']) -class FaultMiddlewareTest(ApiTestCase): +class FaultMiddlewareTest(designate.tests.TestCase): @mock.patch.object(notifier.Notifier, "error") def test_notify_of_fault(self, mock_notifier): self.config(notify_api_faults=True) diff --git a/designate/tests/test_api/test_service.py b/designate/tests/test_api/test_service.py index 702e4af0a..c0b699dc1 100644 --- a/designate/tests/test_api/test_service.py +++ b/designate/tests/test_api/test_service.py @@ -20,10 +20,10 @@ from paste import urlmap from designate.api import service from designate import exceptions -from designate.tests.test_api import ApiTestCase +import designate.tests -class ApiServiceTest(ApiTestCase): +class ApiServiceTest(designate.tests.TestCase): def setUp(self): super(ApiServiceTest, self).setUp() diff --git a/designate/tests/test_api/test_v2/__init__.py b/designate/tests/test_api/test_v2/__init__.py index 938b803a6..962a81c9c 100644 --- a/designate/tests/test_api/test_v2/__init__.py +++ b/designate/tests/test_api/test_v2/__init__.py @@ -20,7 +20,7 @@ from webtest import TestApp from designate.api import middleware from designate.api import v2 as api_v2 -from designate.tests.test_api import ApiTestCase +import designate.tests LOG = logging.getLogger(__name__) @@ -33,7 +33,7 @@ INVALID_ID = [ ] -class ApiV2TestCase(ApiTestCase): +class ApiV2TestCase(designate.tests.TestCase): def setUp(self): super(ApiV2TestCase, self).setUp() diff --git a/designate/tests/test_central/__init__.py b/designate/tests/test_central/__init__.py index 088df403c..e69de29bb 100644 --- a/designate/tests/test_central/__init__.py +++ b/designate/tests/test_central/__init__.py @@ -1,20 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from designate.tests import TestCase - - -class CentralTestCase(TestCase): - pass diff --git a/designate/tests/test_central/test_service.py b/designate/tests/test_central/test_service.py index ae2f34165..21b29aec9 100644 --- a/designate/tests/test_central/test_service.py +++ b/designate/tests/test_central/test_service.py @@ -39,15 +39,15 @@ from designate import exceptions from designate import objects from designate.storage.impl_sqlalchemy import tables from designate.storage import sql +import designate.tests from designate.tests import fixtures -from designate.tests.test_central import CentralTestCase from designate import utils from designate.worker import rpcapi as worker_api LOG = logging.getLogger(__name__) -class CentralServiceTest(CentralTestCase): +class CentralServiceTest(designate.tests.TestCase): def setUp(self): super(CentralServiceTest, self).setUp() self.stdlog = fixtures.StandardLogging() diff --git a/designate/tests/test_manage/__init__.py b/designate/tests/test_manage/__init__.py index dd671f437..e69de29bb 100644 --- a/designate/tests/test_manage/__init__.py +++ b/designate/tests/test_manage/__init__.py @@ -1,5 +0,0 @@ -from designate.tests import TestCase - - -class DesignateManageTestCase(TestCase): - pass diff --git a/designate/tests/test_manage/test_database.py b/designate/tests/test_manage/test_database.py index c318ea424..22d3150c2 100644 --- a/designate/tests/test_manage/test_database.py +++ b/designate/tests/test_manage/test_database.py @@ -15,14 +15,14 @@ from io import StringIO from unittest import mock from designate.manage import database -from designate import tests as designate_tests +import designate.tests -class TestManageDatabase(designate_tests.TestCase): +class TestManageDatabase(designate.tests.TestCase): def setUp(self): super(TestManageDatabase, self).setUp() - self.stdlog = designate_tests.fixtures.StandardLogging() + self.stdlog = designate.tests.fixtures.StandardLogging() self.useFixture(self.stdlog) self.db_cmds = database.DatabaseCommands() diff --git a/designate/tests/test_manage/test_pool.py b/designate/tests/test_manage/test_pool.py index 1abf8f6ae..51927172a 100644 --- a/designate/tests/test_manage/test_pool.py +++ b/designate/tests/test_manage/test_pool.py @@ -20,9 +20,9 @@ import oslo_messaging from designate.central import service from designate.manage import base from designate.manage import pool +import designate.tests from designate.tests import fixtures from designate.tests import resources -from designate.tests.test_manage import DesignateManageTestCase LOG = logging.getLogger(__name__) @@ -36,9 +36,9 @@ def get_pools(name='pools.yaml'): return yaml.safe_load(pool_obj) -class ManagePoolTestCase(DesignateManageTestCase): +class ManagePoolTestCase(designate.tests.TestCase): def setUp(self): - super(DesignateManageTestCase, self).setUp() + super(ManagePoolTestCase, self).setUp() self.stdlog = fixtures.StandardLogging() self.useFixture(self.stdlog) diff --git a/designate/tests/test_manage/test_update_pool.py b/designate/tests/test_manage/test_update_pool.py index c7cf1457d..8254bda8d 100644 --- a/designate/tests/test_manage/test_update_pool.py +++ b/designate/tests/test_manage/test_update_pool.py @@ -17,8 +17,8 @@ from oslo_log import log as logging from designate.manage import base from designate.manage import pool from designate import objects +import designate.tests from designate.tests import fixtures -from designate.tests.test_manage import DesignateManageTestCase LOG = logging.getLogger(__name__) @@ -34,9 +34,9 @@ def hydrate_pool_targets(target_masters): return pool_targets -class UpdatePoolTestCase(DesignateManageTestCase): +class UpdatePoolTestCase(designate.tests.TestCase): def setUp(self): - super(DesignateManageTestCase, self).setUp() + super(UpdatePoolTestCase, self).setUp() self.stdlog = fixtures.StandardLogging() self.useFixture(self.stdlog) diff --git a/designate/tests/test_mdns/__init__.py b/designate/tests/test_mdns/__init__.py index 203ff3340..e69de29bb 100644 --- a/designate/tests/test_mdns/__init__.py +++ b/designate/tests/test_mdns/__init__.py @@ -1,20 +0,0 @@ -# Copyright 2014 Hewlett-Packard Development Company, L.P. -# -# Author: Kiall Mac Innes -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from designate.tests import TestCase - - -class MdnsTestCase(TestCase): - pass diff --git a/designate/tests/test_mdns/test_handler.py b/designate/tests/test_mdns/test_handler.py index d8eeaac1f..9efdfdcd8 100644 --- a/designate/tests/test_mdns/test_handler.py +++ b/designate/tests/test_mdns/test_handler.py @@ -28,7 +28,7 @@ import testtools from designate import context from designate.mdns import handler from designate import objects -from designate.tests.test_mdns import MdnsTestCase +import designate.tests CONF = cfg.CONF default_pool_id = CONF['service:central'].default_pool_id @@ -49,7 +49,7 @@ ANSWER = [ ] -class MdnsRequestHandlerTest(MdnsTestCase): +class MdnsRequestHandlerTest(designate.tests.TestCase): def setUp(self): super(MdnsRequestHandlerTest, self).setUp() self.mock_tg = mock.Mock() diff --git a/designate/tests/test_mdns/test_service.py b/designate/tests/test_mdns/test_service.py index d25f2ab93..4a20c0f90 100644 --- a/designate/tests/test_mdns/test_service.py +++ b/designate/tests/test_mdns/test_service.py @@ -24,7 +24,7 @@ import dns import dns.message from oslo_log import log as logging -from designate.tests.test_mdns import MdnsTestCase +import designate.tests LOG = logging.getLogger(__name__) @@ -33,7 +33,7 @@ def hex_wire(response): return binascii.b2a_hex(response.to_wire()) -class MdnsServiceTest(MdnsTestCase): +class MdnsServiceTest(designate.tests.TestCase): # DNS packet with IQUERY opcode query_payload = binascii.a2b_hex( "271209000001000000000000076578616d706c6503636f6d0000010001" diff --git a/designate/tests/test_quota/test_quota.py b/designate/tests/test_quota/test_quota.py index 0596ec65d..0c685e4ef 100644 --- a/designate/tests/test_quota/test_quota.py +++ b/designate/tests/test_quota/test_quota.py @@ -17,16 +17,17 @@ from unittest import mock from oslo_config import cfg from oslo_log import log as logging -from testscenarios import load_tests_apply_scenarios as load_tests # noqa +import testscenarios from designate import exceptions from designate import quota -from designate import tests +import designate.tests LOG = logging.getLogger(__name__) +load_tests = testscenarios.load_tests_apply_scenarios -class QuotaTestCase(tests.TestCase): +class QuotaTestCase(designate.tests.TestCase): scenarios = [ ('noop', dict(quota_driver='noop')), ('storage', dict(quota_driver='storage'))