Start using to oslotest

oslotest provides a BaseTestCase class then enables proper capturing of
stdout, stderr and logging streams during a test run. We will take
advantage of this capability in the near future.

Change-Id: I16761053f631e709224eee813dc0f423f06c8870
This commit is contained in:
David Stanek 2014-03-06 15:04:53 +00:00
parent ff88763786
commit a2e08781ce
9 changed files with 16 additions and 18 deletions

View File

@ -26,9 +26,9 @@ import warnings
import fixtures
import logging
import oslotest.base as oslotest
from paste import deploy
import six
import testtools
from testtools import testcase
import webob
@ -323,7 +323,7 @@ class NoModule(object):
sys.meta_path.insert(0, finder)
class BaseTestCase(testtools.TestCase):
class BaseTestCase(oslotest.BaseTestCase):
"""Light weight base test class.
This is a placeholder that will eventually go away once thc

View File

@ -20,10 +20,10 @@ import uuid
from dogpile.cache import api
from dogpile.cache import region as dp_region
import six
import testtools
from keystone.common.cache.backends import mongo
from keystone import exception
from keystone import tests
# Mock database structure sample where 'ks_cache' is database and
@ -277,7 +277,7 @@ class MyTransformer(mongo.BaseTransform):
return super(MyTransformer, self).transform_outgoing(son, collection)
class MongoCache(testtools.TestCase):
class MongoCache(tests.BaseTestCase):
def setUp(self):
super(MongoCache, self).setUp()
global COLLECTIONS

View File

@ -12,13 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
import uuid
from keystone.common import dependency
from keystone import tests
class TestDependencyInjection(testtools.TestCase):
class TestDependencyInjection(tests.BaseTestCase):
def setUp(self):
super(TestDependencyInjection, self).setUp()
self.addCleanup(dependency.reset)

View File

@ -14,13 +14,13 @@
import textwrap
import testtools
from testtools.tests.matchers import helpers
from keystone import tests
from keystone.tests import matchers
class TestXMLEquals(testtools.TestCase, helpers.TestMatchersInterface):
class TestXMLEquals(tests.BaseTestCase, helpers.TestMatchersInterface):
matches_xml = """
<?xml version="1.0" encoding="UTF-8"?>
<test xmlns="http://docs.openstack.org/identity/api/v2.0">

View File

@ -12,14 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
import testtools
from keystoneclient.middleware import s3_token as ksc_s3_token
from keystone.middleware import s3_token
from keystone import tests
class S3TokenMiddlewareTestBase(testtools.TestCase):
class S3TokenMiddlewareTestBase(tests.BaseTestCase):
def test_symbols(self):
"""Verify s3_token middleware symbols.

View File

@ -12,9 +12,9 @@
from sqlalchemy.ext import declarative
import testtools
from keystone.common import sql
from keystone import tests
from keystone.tests import utils
@ -27,7 +27,7 @@ class TestModel(ModelBase, sql.ModelDictMixin):
text = sql.Column(sql.String(64), nullable=False)
class TestModelDictMixin(testtools.TestCase):
class TestModelDictMixin(tests.BaseTestCase):
def test_creating_a_model_instance_from_a_dict(self):
d = {'id': utils.new_uuid(), 'text': utils.new_uuid()}

View File

@ -12,12 +12,11 @@
import uuid
import testtools
from keystone.common import utils
from keystone import tests
class TestPasswordHashing(testtools.TestCase):
class TestPasswordHashing(tests.BaseTestCase):
def setUp(self):
super(TestPasswordHashing, self).setUp()

View File

@ -16,7 +16,6 @@ import os
import uuid
import mock
import testtools
from keystone import config
from keystone import exception
@ -27,7 +26,7 @@ from keystone import tests
CONF = config.CONF
class TestDomainConfigs(testtools.TestCase):
class TestDomainConfigs(tests.BaseTestCase):
def setUp(self):
super(TestDomainConfigs, self).setUp()

View File

@ -21,6 +21,7 @@ fixtures>=0.3.14
# mock object framework
mock>=1.0
mox>=0.5.3
oslotest
# required to build documentation
sphinx>=1.1.2,<1.2
# test wsgi apps without starting an http server