From f96deb870b0294e3748523756b171d8332699294 Mon Sep 17 00:00:00 2001 From: Oleksii Chuprykov Date: Thu, 17 Jul 2014 16:09:46 +0300 Subject: [PATCH] Remove moxstubout.py from oslo.db Remove moxstubout.py from common/fixture becouse it is duplicated in oslotest Change-Id: I6480c24a1b6f9d01af918d416ca14439cff31db0 --- openstack-common.conf | 1 - .../db/openstack/common/fixture/moxstubout.py | 43 ------------------- tests/sqlalchemy/test_utils.py | 2 +- tests/utils.py | 3 +- 4 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 oslo/db/openstack/common/fixture/moxstubout.py diff --git a/openstack-common.conf b/openstack-common.conf index 1df4b2f..e910dc2 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -2,7 +2,6 @@ # The list of modules to copy from oslo-incubator.git module=gettextutils -module=fixture.moxstubout module=importutils module=fixture.config module=timeutils diff --git a/oslo/db/openstack/common/fixture/moxstubout.py b/oslo/db/openstack/common/fixture/moxstubout.py deleted file mode 100644 index e4cd025..0000000 --- a/oslo/db/openstack/common/fixture/moxstubout.py +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# Copyright 2013 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. -# -# 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. - -############################################################################## -############################################################################## -## -## DO NOT MODIFY THIS FILE -## -## This file is being graduated to the oslo.dbtest library. Please make all -## changes there, and only backport critical fixes here. - dhellmann -## -############################################################################## -############################################################################## - -import fixtures -from six.moves import mox - - -class MoxStubout(fixtures.Fixture): - """Deal with code around mox and stubout as a fixture.""" - - def setUp(self): - super(MoxStubout, self).setUp() - # emulate some of the mox stuff, we can't use the metaclass - # because it screws with our generators - self.mox = mox.Mox() - self.stubs = self.mox.stubs - self.addCleanup(self.mox.UnsetStubs) - self.addCleanup(self.mox.VerifyAll) diff --git a/tests/sqlalchemy/test_utils.py b/tests/sqlalchemy/test_utils.py index effa884..6c8ade9 100644 --- a/tests/sqlalchemy/test_utils.py +++ b/tests/sqlalchemy/test_utils.py @@ -20,6 +20,7 @@ import warnings from migrate.changeset import UniqueConstraint import mock from oslotest import base as test_base +from oslotest import moxstubout import six from six import moves from six.moves.urllib import parse @@ -34,7 +35,6 @@ from sqlalchemy.sql import select from sqlalchemy.types import UserDefinedType, NullType from oslo.db import exception -from oslo.db.openstack.common.fixture import moxstubout from oslo.db.sqlalchemy import models from oslo.db.sqlalchemy import session from oslo.db.sqlalchemy import test_base as db_test_base diff --git a/tests/utils.py b/tests/utils.py index 93571cc..c21a618 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -15,8 +15,7 @@ from oslo.config import cfg from oslotest import base as test_base - -from oslo.db.openstack.common.fixture import moxstubout +from oslotest import moxstubout class BaseTestCase(test_base.BaseTestCase):