blob: a0e74fd11ec618186d6dca27572f366d0a95031c [file] [log] [blame]
Matthew Treinish9b4d5882013-10-24 20:00:11 +00001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2010 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.
5# Copyright 2013 Hewlett-Packard Development Company, L.P.
6# All Rights Reserved.
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License. You may obtain
10# a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17# License for the specific language governing permissions and limitations
18# under the License.
19
20import fixtures
21import mox
22
23
24class MoxStubout(fixtures.Fixture):
25 """Deal with code around mox and stubout as a fixture."""
26
27 def setUp(self):
28 super(MoxStubout, self).setUp()
29 # emulate some of the mox stuff, we can't use the metaclass
30 # because it screws with our generators
31 self.mox = mox.Mox()
32 self.stubs = self.mox.stubs
33 self.addCleanup(self.mox.UnsetStubs)
34 self.addCleanup(self.mox.VerifyAll)