diff options
author | Takashi Natsume <takanattie@gmail.com> | 2020-05-14 15:01:28 +0000 |
---|---|---|
committer | Takashi Natsume <takanattie@gmail.com> | 2020-12-13 11:26:35 +0000 |
commit | 1cf2431f4bf815fc828a7878bd80f5f5bd8e8319 (patch) | |
tree | d493731db6a3bca4d6d7becb8f5cee594ce767be /nova/tests/unit/test_test.py | |
parent | 383e2a8bdcc9210cbe9719d3470fe15b787d46b0 (diff) | |
download | nova-1cf2431f4bf815fc828a7878bd80f5f5bd8e8319.tar.gz |
Remove six.text_type (2/2)
Replace six.text_type with str.
This patch completes six removal.
Change-Id: I779bd1446dc1f070fa5100ccccda7881fa508d79
Implements: blueprint six-removal
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
Diffstat (limited to 'nova/tests/unit/test_test.py')
-rw-r--r-- | nova/tests/unit/test_test.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/nova/tests/unit/test_test.py b/nova/tests/unit/test_test.py index 78bb36815b..97a1f7792f 100644 --- a/nova/tests/unit/test_test.py +++ b/nova/tests/unit/test_test.py @@ -23,7 +23,6 @@ import uuid import mock from oslo_log import log as logging import oslo_messaging as messaging -import six import nova.conf from nova import exception @@ -125,10 +124,10 @@ class JsonTestCase(test.NoDBTestCase): e.difference) self.assertIn( "actual:\n{'top': {'l1': {'l2': ['c', 'a', 'b', 'd']}}}", - six.text_type(e)) + str(e)) self.assertIn( "expected:\n{'top': {'l1': {'l2': ['a', 'b', 'c']}}}", - six.text_type(e)) + str(e)) else: self.fail("This should have raised a mismatch exception") @@ -206,10 +205,10 @@ class JsonTestCase(test.NoDBTestCase): e.difference) self.assertIn( "actual:\n{'top': {'l1': {'l2': ['c', 'a', 'd']}}}", - six.text_type(e)) + str(e)) self.assertIn( "expected:\n{'top': {'l1': {'l2': ['a', 'b', 'c']}}}", - six.text_type(e)) + str(e)) else: self.fail("This should have raised a mismatch exception") @@ -233,11 +232,9 @@ class JsonTestCase(test.NoDBTestCase): except Exception as e: self.assertEqual( "3 != 4: path: root.top.l1.l2.c", e.difference) - self.assertIn("actual:\n{'top': {'l1': {'l2': {", six.text_type(e)) - self.assertIn( - "expected:\n{'top': {'l1': {'l2': {", six.text_type(e)) - self.assertIn( - "message: test message\n", six.text_type(e)) + self.assertIn("actual:\n{'top': {'l1': {'l2': {", str(e)) + self.assertIn("expected:\n{'top': {'l1': {'l2': {", str(e)) + self.assertIn("message: test message\n", str(e)) else: self.fail("This should have raised a mismatch exception") @@ -310,13 +307,13 @@ class NovaExceptionReraiseFormatErrorTestCase(test.NoDBTestCase): # wrong kwarg ex = self.assertRaises(KeyError, FakeImageException, bogus='wrongkwarg') - self.assertIn('image_id', six.text_type(ex)) + self.assertIn('image_id', str(ex)) # no kwarg ex = self.assertRaises(KeyError, FakeImageException) - self.assertIn('image_id', six.text_type(ex)) + self.assertIn('image_id', str(ex)) # not enough kwargs ex = self.assertRaises(KeyError, FakeImageException, image_id='image') - self.assertIn('type', six.text_type(ex)) + self.assertIn('type', str(ex)) class PatchExistsTestCase(test.NoDBTestCase): |