From 31810473cf17dfc4fccd0a14dcd1b1faf22ed12f Mon Sep 17 00:00:00 2001 From: Flaper Fesp Date: Fri, 30 Aug 2013 13:58:11 +0200 Subject: [PATCH] Remove util packages This patch moves modules under util/ packages out to the parent level. blueprint refactor-system-tests Change-Id: Ib148a75647e42d7bc2a81488e78c10adf4b849dc --- marconi/tests/__init__.py | 6 ++++++ marconi/tests/{util => }/base.py | 0 marconi/tests/common/test_cache.py | 2 +- marconi/tests/{util => }/faulty_storage.py | 0 marconi/tests/functional/__init__.py | 2 +- marconi/tests/functional/{util => }/base.py | 0 marconi/tests/functional/{util => }/config.py | 0 marconi/tests/functional/{util => }/helpers.py | 0 marconi/tests/functional/{util => }/http.py | 0 marconi/tests/functional/util/__init__.py | 16 ---------------- marconi/tests/{util => }/helpers.py | 0 marconi/tests/util/__init__.py | 7 ------- tests/functional/test_claims.py | 8 ++++---- tests/functional/test_messages.py | 8 ++++---- tests/functional/test_queue.py | 8 ++++---- tests/storage/base.py | 2 +- tests/storage/test_impl_mongodb.py | 2 +- tests/test_bootstrap.py | 2 +- tests/test_config.py | 2 +- tests/transport/test_auth.py | 4 ++-- tests/transport/wsgi/base.py | 12 ++++++------ 21 files changed, 32 insertions(+), 49 deletions(-) rename marconi/tests/{util => }/base.py (100%) rename marconi/tests/{util => }/faulty_storage.py (100%) rename marconi/tests/functional/{util => }/base.py (100%) rename marconi/tests/functional/{util => }/config.py (100%) rename marconi/tests/functional/{util => }/helpers.py (100%) rename marconi/tests/functional/{util => }/http.py (100%) delete mode 100644 marconi/tests/functional/util/__init__.py rename marconi/tests/{util => }/helpers.py (100%) delete mode 100644 marconi/tests/util/__init__.py diff --git a/marconi/tests/__init__.py b/marconi/tests/__init__.py index 1413a3e23..2f5d176fa 100644 --- a/marconi/tests/__init__.py +++ b/marconi/tests/__init__.py @@ -14,3 +14,9 @@ # limitations under the License. """Marconi Unit-ish Tests""" + +from marconi.tests import base +from marconi.tests import helpers + +TestBase = base.TestBase +expect = helpers.expect diff --git a/marconi/tests/util/base.py b/marconi/tests/base.py similarity index 100% rename from marconi/tests/util/base.py rename to marconi/tests/base.py diff --git a/marconi/tests/common/test_cache.py b/marconi/tests/common/test_cache.py index a11f46c47..3ae7df257 100644 --- a/marconi/tests/common/test_cache.py +++ b/marconi/tests/common/test_cache.py @@ -16,7 +16,7 @@ import traceback -from marconi.tests import util as testing +from marconi import tests as testing class TestCache(testing.TestBase): diff --git a/marconi/tests/util/faulty_storage.py b/marconi/tests/faulty_storage.py similarity index 100% rename from marconi/tests/util/faulty_storage.py rename to marconi/tests/faulty_storage.py diff --git a/marconi/tests/functional/__init__.py b/marconi/tests/functional/__init__.py index 14a86d69d..841dae8b1 100644 --- a/marconi/tests/functional/__init__.py +++ b/marconi/tests/functional/__init__.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Marconi Functional Tests""" +"""Functional Test Utilities""" diff --git a/marconi/tests/functional/util/base.py b/marconi/tests/functional/base.py similarity index 100% rename from marconi/tests/functional/util/base.py rename to marconi/tests/functional/base.py diff --git a/marconi/tests/functional/util/config.py b/marconi/tests/functional/config.py similarity index 100% rename from marconi/tests/functional/util/config.py rename to marconi/tests/functional/config.py diff --git a/marconi/tests/functional/util/helpers.py b/marconi/tests/functional/helpers.py similarity index 100% rename from marconi/tests/functional/util/helpers.py rename to marconi/tests/functional/helpers.py diff --git a/marconi/tests/functional/util/http.py b/marconi/tests/functional/http.py similarity index 100% rename from marconi/tests/functional/util/http.py rename to marconi/tests/functional/http.py diff --git a/marconi/tests/functional/util/__init__.py b/marconi/tests/functional/util/__init__.py deleted file mode 100644 index 841dae8b1..000000000 --- a/marconi/tests/functional/util/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2013 Rackspace Hosting, Inc. -# -# 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. - -"""Functional Test Utilities""" diff --git a/marconi/tests/util/helpers.py b/marconi/tests/helpers.py similarity index 100% rename from marconi/tests/util/helpers.py rename to marconi/tests/helpers.py diff --git a/marconi/tests/util/__init__.py b/marconi/tests/util/__init__.py deleted file mode 100644 index 6a566a6cc..000000000 --- a/marconi/tests/util/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Test utilities""" - -from marconi.tests.util import base -from marconi.tests.util import helpers - -TestBase = base.TestBase -expect = helpers.expect diff --git a/tests/functional/test_claims.py b/tests/functional/test_claims.py index 411d36ead..69f2dbedd 100644 --- a/tests/functional/test_claims.py +++ b/tests/functional/test_claims.py @@ -12,10 +12,10 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -from marconi.tests.functional.util import base # noqa -from marconi.tests.functional.util import config -from marconi.tests.functional.util import helpers -from marconi.tests.functional.util import http +from marconi.tests.functional import base # noqa +from marconi.tests.functional import config +from marconi.tests.functional import helpers +from marconi.tests.functional import http import ddt import json diff --git a/tests/functional/test_messages.py b/tests/functional/test_messages.py index e9c4ebd8c..71e0a2cc4 100644 --- a/tests/functional/test_messages.py +++ b/tests/functional/test_messages.py @@ -12,10 +12,10 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -from marconi.tests.functional.util import base # noqa -from marconi.tests.functional.util import config -from marconi.tests.functional.util import helpers -from marconi.tests.functional.util import http +from marconi.tests.functional import base # noqa +from marconi.tests.functional import config +from marconi.tests.functional import helpers +from marconi.tests.functional import http import ddt import uuid diff --git a/tests/functional/test_queue.py b/tests/functional/test_queue.py index 4eb08fdf0..aaf0b30df 100644 --- a/tests/functional/test_queue.py +++ b/tests/functional/test_queue.py @@ -13,10 +13,10 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -from marconi.tests.functional.util import base # noqa -from marconi.tests.functional.util import config -from marconi.tests.functional.util import helpers -from marconi.tests.functional.util import http +from marconi.tests.functional import base # noqa +from marconi.tests.functional import config +from marconi.tests.functional import helpers +from marconi.tests.functional import http import copy import ddt diff --git a/tests/storage/base.py b/tests/storage/base.py index 7983d1771..21f3703c3 100644 --- a/tests/storage/base.py +++ b/tests/storage/base.py @@ -20,7 +20,7 @@ from testtools import matchers from marconi.openstack.common import timeutils from marconi import storage from marconi.storage import exceptions -from marconi.tests import util as testing +from marconi import tests as testing class ControllerBaseTest(testing.TestBase): diff --git a/tests/storage/test_impl_mongodb.py b/tests/storage/test_impl_mongodb.py index 575362268..863ab4d9e 100644 --- a/tests/storage/test_impl_mongodb.py +++ b/tests/storage/test_impl_mongodb.py @@ -28,7 +28,7 @@ from marconi.storage import mongodb from marconi.storage.mongodb import controllers from marconi.storage.mongodb import options as mongodb_options from marconi.storage.mongodb import utils -from marconi.tests import util as testing +from marconi import tests as testing import base # noqa # noqa diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 5e8a15186..51ffdf647 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -18,7 +18,7 @@ from oslo.config import cfg import marconi from marconi.common import exceptions from marconi.storage import sqlite -from marconi.tests.util import base +from marconi.tests import base from marconi.transport import wsgi diff --git a/tests/test_config.py b/tests/test_config.py index fd4452c06..e047184e9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -14,7 +14,7 @@ # limitations under the License. from marconi.common import config -from marconi.tests import util as testing +from marconi import tests as testing PROJECT_CONFIG = config.project() diff --git a/tests/transport/test_auth.py b/tests/transport/test_auth.py index d66c5f531..9b3d37ccd 100644 --- a/tests/transport/test_auth.py +++ b/tests/transport/test_auth.py @@ -17,11 +17,11 @@ from oslo.config import cfg from marconi.common import config -from marconi.tests import util +from marconi import tests as testing from marconi.transport import auth -class TestTransportAuth(util.TestBase): +class TestTransportAuth(testing.TestBase): def setUp(self): super(TestTransportAuth, self).setUp() diff --git a/tests/transport/wsgi/base.py b/tests/transport/wsgi/base.py index 57348d729..44587f4fd 100644 --- a/tests/transport/wsgi/base.py +++ b/tests/transport/wsgi/base.py @@ -14,14 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from falcon import testing +from falcon import testing as ftest import marconi -from marconi.tests import util -from marconi.tests.util import faulty_storage +from marconi import tests as testing +from marconi.tests import faulty_storage -class TestBase(util.TestBase): +class TestBase(testing.TestBase): config_filename = None @@ -35,7 +35,7 @@ class TestBase(util.TestBase): boot = marconi.Bootstrap(conf_file) self.app = boot.transport.app - self.srmock = testing.StartResponseMock() + self.srmock = ftest.StartResponseMock() def simulate_request(self, path, project_id=None, **kwargs): """Simulate a request. @@ -55,7 +55,7 @@ class TestBase(util.TestBase): headers['X-Project-ID'] = project_id kwargs['headers'] = headers - return self.app(testing.create_environ(path=path, **kwargs), + return self.app(ftest.create_environ(path=path, **kwargs), self.srmock) def simulate_get(self, *args, **kwargs):