Merge "Start using oslotest for tempest unit tests"

This commit is contained in:
Jenkins 2014-05-30 14:31:09 +00:00 committed by Gerrit Code Review
commit e59275a21a
5 changed files with 10 additions and 20 deletions

@ -12,28 +12,16 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import os
import fixtures
import mock import mock
import testtools
from tempest.openstack.common.fixture import moxstubout from oslotest import base
from oslotest import moxstubout
class TestCase(testtools.TestCase): class TestCase(base.BaseTestCase):
def setUp(self): def setUp(self):
super(TestCase, self).setUp() super(TestCase, self).setUp()
if (os.environ.get('OS_STDOUT_CAPTURE') == 'True' or
os.environ.get('OS_STDOUT_CAPTURE') == '1'):
stdout = self.useFixture(fixtures.StringStream('stdout')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout))
if (os.environ.get('OS_STDERR_CAPTURE') == 'True' or
os.environ.get('OS_STDERR_CAPTURE') == '1'):
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
mox_fixture = self.useFixture(moxstubout.MoxStubout()) mox_fixture = self.useFixture(moxstubout.MoxStubout())
self.mox = mox_fixture.mox self.mox = mox_fixture.mox
self.stubs = mox_fixture.stubs self.stubs = mox_fixture.stubs

@ -16,11 +16,12 @@
import copy import copy
import datetime import datetime
from oslotest import mockpatch
from tempest import auth from tempest import auth
from tempest.common import http from tempest.common import http
from tempest import config from tempest import config
from tempest import exceptions from tempest import exceptions
from tempest.openstack.common.fixture import mockpatch
from tempest.tests import base from tempest.tests import base
from tempest.tests import fake_auth_provider from tempest.tests import fake_auth_provider
from tempest.tests import fake_config from tempest.tests import fake_config

@ -14,13 +14,12 @@
import mock import mock
import testtools
from oslo.config import cfg from oslo.config import cfg
from oslotest import mockpatch
import testtools
from tempest import config from tempest import config
from tempest import exceptions from tempest import exceptions
from tempest.openstack.common.fixture import mockpatch
from tempest import test from tempest import test
from tempest.tests import base from tempest.tests import base
from tempest.tests import fake_config from tempest.tests import fake_config

@ -15,11 +15,12 @@
import httplib2 import httplib2
import json import json
from oslotest import mockpatch
from tempest.common import rest_client from tempest.common import rest_client
from tempest.common import xml_utils as xml from tempest.common import xml_utils as xml
from tempest import config from tempest import config
from tempest import exceptions from tempest import exceptions
from tempest.openstack.common.fixture import mockpatch
from tempest.tests import base from tempest.tests import base
from tempest.tests import fake_auth_provider from tempest.tests import fake_auth_provider
from tempest.tests import fake_config from tempest.tests import fake_config

@ -7,3 +7,4 @@ oslosphinx
mox>=0.5.3 mox>=0.5.3
mock>=1.0 mock>=1.0
coverage>=3.6 coverage>=3.6
oslotest