diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-05-31 14:21:11 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-05-31 14:21:11 +0000 |
commit | 762e62317f1028e65aedd4ab9494479433264022 (patch) | |
tree | c955b42a05bffcb99679f7c8cb466e79ea7b91c3 | |
parent | 7e2805025d86220df0678110df933745a46db178 (diff) | |
parent | ba849efe75f9ca267e03ca22e8647f140bbaaf66 (diff) | |
download | oslo-762e62317f1028e65aedd4ab9494479433264022.tar.gz oslo-762e62317f1028e65aedd4ab9494479433264022.tar.xz oslo-762e62317f1028e65aedd4ab9494479433264022.zip |
Merge "Use mox object from moxstubout fixture"
-rw-r--r-- | tests/unit/rpc/test_qpid.py | 2 | ||||
-rw-r--r-- | tests/unit/scheduler/test_base_filter.py | 3 | ||||
-rw-r--r-- | tests/utils.py | 4 |
3 files changed, 3 insertions, 6 deletions
diff --git a/tests/unit/rpc/test_qpid.py b/tests/unit/rpc/test_qpid.py index 82cc119..1630ac4 100644 --- a/tests/unit/rpc/test_qpid.py +++ b/tests/unit/rpc/test_qpid.py @@ -69,7 +69,6 @@ class RpcQpidTestCase(utils.BaseTestCase): self.mock_session = None self.mock_sender = None self.mock_receiver = None - self.mox = mox.Mox() self.orig_connection = qpid.messaging.Connection self.orig_session = qpid.messaging.Session @@ -437,7 +436,6 @@ class RpcQpidTestCase(utils.BaseTestCase): if expect_failure: self.mock_session.next_receiver(timeout=mox.IsA(int)).AndRaise( qpid.messaging.exceptions.Empty()) - self.mock_receiver.fetch() self.mock_session.close() self.mock_connection.session().AndReturn(self.mock_session) else: diff --git a/tests/unit/scheduler/test_base_filter.py b/tests/unit/scheduler/test_base_filter.py index 65809ea..d66d84c 100644 --- a/tests/unit/scheduler/test_base_filter.py +++ b/tests/unit/scheduler/test_base_filter.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mox - from openstack.common.scheduler import base_filter from tests import utils @@ -25,7 +23,6 @@ class TestBaseFilter(utils.BaseTestCase): def setUp(self): super(TestBaseFilter, self).setUp() self.filter = base_filter.BaseFilter() - self.mox = mox.Mox() def test_filter_one_is_called(self): filters = [1, 2, 3, 4] diff --git a/tests/utils.py b/tests/utils.py index 4682428..7d0cc85 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -34,7 +34,9 @@ class BaseTestCase(testtools.TestCase): def setUp(self): super(BaseTestCase, self).setUp() - self.stubs = self.useFixture(moxstubout.MoxStubout()).stubs + moxfixture = self.useFixture(moxstubout.MoxStubout()) + self.mox = moxfixture.mox + self.stubs = moxfixture.stubs self.addCleanup(CONF.reset) self.useFixture(fixtures.FakeLogger('openstack.common')) self.useFixture(fixtures.Timeout(30, True)) |