Remove six from unit tests (part 3)

This is part of the steps to remove usage of six library, which is no
longer needed since python 2 support was removed.

Change-Id: I683a86eeab858c3f57c587e653ae53aff052fe9c
This commit is contained in:
Takashi Kajinami
2024-02-17 12:14:52 +09:00
parent 26ec32c7be
commit 51e0a2205d
2 changed files with 4 additions and 7 deletions

View File

@@ -17,8 +17,6 @@
from unittest import mock
from unittest.mock import patch
import six
from heatclient import exc
from oslo_service import loopingcall
from pycadf import cadftaxonomy as taxonomy
@@ -380,9 +378,9 @@ class TestHandler(db_base.DbTestCase):
mock_cert_manager,
mock_trust_manager,
mock_cluster_create):
error_message = six.u("""Invalid stack name 测试集群-zoyh253geukk
must contain only alphanumeric or "_-."
characters, must start with alpha""")
error_message = ("Invalid stack name 测试集群-zoyh253geukk must "
"contain only alphanumeric or \"_-.\" characters, "
"must start with alpha")
mock_dr = mock.MagicMock()
mock_driver.return_value = mock_dr
mock_dr.create_cluster.side_effect = exc.HTTPBadRequest(error_message)

View File

@@ -16,7 +16,6 @@ import collections
from unittest import mock
from oslo_config import cfg
import six
from magnum.conf import opts
from magnum.tests import base
@@ -26,7 +25,7 @@ class ConfTestCase(base.TestCase):
def test_list_opts(self):
for group, opt_list in opts.list_opts():
if isinstance(group, six.string_types):
if isinstance(group, str):
self.assertEqual(group, 'DEFAULT')
else:
self.assertIsInstance(group, cfg.OptGroup)