summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_exc.py4
-rw-r--r--tests/test_http.py6
-rw-r--r--tests/test_ssl.py4
-rw-r--r--tests/test_utils.py4
-rw-r--r--tests/v1/test_image_members.py5
-rw-r--r--tests/v1/test_images.py8
-rw-r--r--tests/v2/test_images.py4
-rw-r--r--tests/v2/test_schemas.py8
-rw-r--r--tools/test-requires1
9 files changed, 24 insertions, 20 deletions
diff --git a/tests/test_exc.py b/tests/test_exc.py
index 33d1ad2..5177556 100644
--- a/tests/test_exc.py
+++ b/tests/test_exc.py
@@ -14,7 +14,7 @@
# under the License.
import collections
-import unittest
+import testtools
from glanceclient import exc
@@ -22,7 +22,7 @@ from glanceclient import exc
FakeResponse = collections.namedtuple('HTTPResponse', ['status'])
-class TestHTTPExceptions(unittest.TestCase):
+class TestHTTPExceptions(testtools.TestCase):
def test_from_response(self):
"""exc.from_response should return instance of an HTTP exception"""
out = exc.from_response(FakeResponse(400))
diff --git a/tests/test_http.py b/tests/test_http.py
index 783f6ca..4cf8e2f 100644
--- a/tests/test_http.py
+++ b/tests/test_http.py
@@ -16,7 +16,7 @@
import httplib
import socket
import StringIO
-import unittest
+import testtools
import mox
@@ -25,7 +25,7 @@ from glanceclient.common import http
from tests import utils
-class TestClient(unittest.TestCase):
+class TestClient(testtools.TestCase):
def test_connection_refused(self):
"""
Should receive a CommunicationError if connection refused.
@@ -57,7 +57,7 @@ class TestClient(unittest.TestCase):
m.UnsetStubs()
-class TestResponseBodyIterator(unittest.TestCase):
+class TestResponseBodyIterator(testtools.TestCase):
def test_iter_default_chunk_size_64k(self):
resp = utils.FakeResponse({}, StringIO.StringIO('X' * 98304))
iterator = http.ResponseBodyIterator(resp)
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index 14afcc6..8ee179f 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -14,7 +14,7 @@
# under the License.
import os
-import unittest
+import testtools
from OpenSSL import crypto
@@ -26,7 +26,7 @@ TEST_VAR_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
'var'))
-class TestVerifiedHTTPSConnection(unittest.TestCase):
+class TestVerifiedHTTPSConnection(testtools.TestCase):
def test_ssl_init_ok(self):
"""
Test VerifiedHTTPSConnection class init
diff --git a/tests/test_utils.py b/tests/test_utils.py
index f6fe14d..07a589a 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -14,12 +14,12 @@
# under the License.
import errno
-import unittest
+import testtools
from glanceclient.common import utils
-class TestUtils(unittest.TestCase):
+class TestUtils(testtools.TestCase):
def test_integrity_iter_without_checksum(self):
try:
diff --git a/tests/v1/test_image_members.py b/tests/v1/test_image_members.py
index 1013ad8..6a890a4 100644
--- a/tests/v1/test_image_members.py
+++ b/tests/v1/test_image_members.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import unittest
+import testtools
import glanceclient.v1.images
import glanceclient.v1.image_members
@@ -52,9 +52,10 @@ fixtures = {
}
-class ImageMemberManagerTest(unittest.TestCase):
+class ImageMemberManagerTest(testtools.TestCase):
def setUp(self):
+ super(ImageMemberManagerTest, self).setUp()
self.api = utils.FakeAPI(fixtures)
self.mgr = glanceclient.v1.image_members.ImageMemberManager(self.api)
self.image = glanceclient.v1.images.Image(self.api, {'id': '1'}, True)
diff --git a/tests/v1/test_images.py b/tests/v1/test_images.py
index 1b4e85b..a9d4eeb 100644
--- a/tests/v1/test_images.py
+++ b/tests/v1/test_images.py
@@ -16,7 +16,7 @@
import errno
import json
import StringIO
-import unittest
+import testtools
import glanceclient.v1.images
from tests import utils
@@ -239,9 +239,10 @@ fixtures = {
}
-class ImageManagerTest(unittest.TestCase):
+class ImageManagerTest(testtools.TestCase):
def setUp(self):
+ super(ImageManagerTest, self).setUp()
self.api = utils.FakeAPI(fixtures)
self.mgr = glanceclient.v1.images.ImageManager(self.api)
@@ -448,8 +449,9 @@ class ImageManagerTest(unittest.TestCase):
self.assertEqual(self.api.calls, expect)
-class ImageTest(unittest.TestCase):
+class ImageTest(testtools.TestCase):
def setUp(self):
+ super(ImageTest, self).setUp()
self.api = utils.FakeAPI(fixtures)
self.mgr = glanceclient.v1.images.ImageManager(self.api)
diff --git a/tests/v2/test_images.py b/tests/v2/test_images.py
index 07bcf6b..3b08915 100644
--- a/tests/v2/test_images.py
+++ b/tests/v2/test_images.py
@@ -14,7 +14,7 @@
# under the License.
import errno
-import unittest
+import testtools
import warlock
@@ -102,7 +102,7 @@ fake_schema = {'name': 'image', 'properties': {'id': {}, 'name': {}}}
FakeModel = warlock.model_factory(fake_schema)
-class TestController(unittest.TestCase):
+class TestController(testtools.TestCase):
def setUp(self):
super(TestController, self).setUp()
self.api = utils.FakeAPI(fixtures)
diff --git a/tests/v2/test_schemas.py b/tests/v2/test_schemas.py
index b11b480..ff286df 100644
--- a/tests/v2/test_schemas.py
+++ b/tests/v2/test_schemas.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import unittest
+import testtools
from glanceclient.v2 import schemas
from tests import utils
@@ -43,7 +43,7 @@ fixtures = {
}
-class TestSchemaProperty(unittest.TestCase):
+class TestSchemaProperty(testtools.TestCase):
def test_property_minimum(self):
prop = schemas.SchemaProperty('size')
self.assertEqual(prop.name, 'size')
@@ -54,7 +54,7 @@ class TestSchemaProperty(unittest.TestCase):
self.assertEqual(prop.description, 'some quantity')
-class TestSchema(unittest.TestCase):
+class TestSchema(testtools.TestCase):
def test_schema_minimum(self):
raw_schema = {'name': 'Country', 'properties': {}}
schema = schemas.Schema(raw_schema)
@@ -73,7 +73,7 @@ class TestSchema(unittest.TestCase):
self.assertEqual(schema.raw(), raw_schema)
-class TestController(unittest.TestCase):
+class TestController(testtools.TestCase):
def setUp(self):
super(TestController, self).setUp()
self.api = utils.FakeAPI(fixtures)
diff --git a/tools/test-requires b/tools/test-requires
index 7e6512f..f1ae9bd 100644
--- a/tools/test-requires
+++ b/tools/test-requires
@@ -9,3 +9,4 @@ nosehtmloutput
pep8==1.3.3
setuptools-git>=0.4
sphinx>=1.1.2
+testtools>=0.9.22