From 5f664f279c340303a7e953aee5d66f4ffe04abca Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 16 Oct 2013 16:21:27 +0000 Subject: [PATCH] Removes unwanted mox and fixture files Module ironic.openstack.commom.fixture.moxstubout and mockptch are no longer needed, so the whole directory is removed by this patch. mox is removed from test-requirements.txt because it is no longer used in ironic unit test cases. Change-Id: I6060546b565c096c3a602b22f28b5d84b8a03b24 --- ironic/openstack/common/fixture/__init__.py | 0 ironic/openstack/common/fixture/mockpatch.py | 51 ------------------- ironic/openstack/common/fixture/moxstubout.py | 37 -------------- openstack-common.conf | 1 - test-requirements.txt | 1 - 5 files changed, 90 deletions(-) delete mode 100644 ironic/openstack/common/fixture/__init__.py delete mode 100644 ironic/openstack/common/fixture/mockpatch.py delete mode 100644 ironic/openstack/common/fixture/moxstubout.py diff --git a/ironic/openstack/common/fixture/__init__.py b/ironic/openstack/common/fixture/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ironic/openstack/common/fixture/mockpatch.py b/ironic/openstack/common/fixture/mockpatch.py deleted file mode 100644 index cd0d6ca6b5..0000000000 --- a/ironic/openstack/common/fixture/mockpatch.py +++ /dev/null @@ -1,51 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# 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. - -import fixtures -import mock - - -class PatchObject(fixtures.Fixture): - """Deal with code around mock.""" - - def __init__(self, obj, attr, **kwargs): - self.obj = obj - self.attr = attr - self.kwargs = kwargs - - def setUp(self): - super(PatchObject, self).setUp() - _p = mock.patch.object(self.obj, self.attr, **self.kwargs) - self.mock = _p.start() - self.addCleanup(_p.stop) - - -class Patch(fixtures.Fixture): - - """Deal with code around mock.patch.""" - - def __init__(self, obj, **kwargs): - self.obj = obj - self.kwargs = kwargs - - def setUp(self): - super(Patch, self).setUp() - _p = mock.patch(self.obj, **self.kwargs) - self.mock = _p.start() - self.addCleanup(_p.stop) diff --git a/ironic/openstack/common/fixture/moxstubout.py b/ironic/openstack/common/fixture/moxstubout.py deleted file mode 100644 index f277fdd739..0000000000 --- a/ironic/openstack/common/fixture/moxstubout.py +++ /dev/null @@ -1,37 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -# 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. - -import fixtures -import mox -import stubout - - -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 = stubout.StubOutForTesting() - self.addCleanup(self.mox.UnsetStubs) - self.addCleanup(self.stubs.UnsetAll) - self.addCleanup(self.stubs.SmartUnsetAll) - self.addCleanup(self.mox.VerifyAll) diff --git a/openstack-common.conf b/openstack-common.conf index add9c18d0f..2782abd43c 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -7,7 +7,6 @@ module=db.sqlalchemy module=eventlet_backdoor module=excutils module=fileutils -module=fixture module=flakes module=gettextutils module=importutils diff --git a/test-requirements.txt b/test-requirements.txt index a3244e2c1a..0d759210e1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,6 @@ coverage>=3.6 discover fixtures>=0.3.14 mock>=1.0 -mox>=0.5.3 Babel>=1.3 MySQL-python psycopg2