diff options
| author | songwenping <songwenping@inspur.com> | 2020-10-06 14:26:27 +0800 |
|---|---|---|
| committer | root <songwenping@inspur.com> | 2020-10-07 02:15:25 +0000 |
| commit | c2df9215e19752714e83fcad82c8ae3708f85d7a (patch) | |
| tree | cfcf7e7041dcb4e4532a645d087140053bc5deca /openstackclient/tests/unit/object | |
| parent | 098a3fe2dea70eb16f13b717d62f51a4c890891d (diff) | |
| download | python-openstackclient-c2df9215e19752714e83fcad82c8ae3708f85d7a.tar.gz | |
Remove usage of six
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.
Change-Id: I84848c0bf8ab3c36dd821141191e2725e4e3b58b
Diffstat (limited to 'openstackclient/tests/unit/object')
| -rw-r--r-- | openstackclient/tests/unit/object/v1/fakes.py | 3 | ||||
| -rw-r--r-- | openstackclient/tests/unit/object/v1/test_object_all.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/openstackclient/tests/unit/object/v1/fakes.py b/openstackclient/tests/unit/object/v1/fakes.py index 0ed791a5..1808d5b7 100644 --- a/openstackclient/tests/unit/object/v1/fakes.py +++ b/openstackclient/tests/unit/object/v1/fakes.py @@ -14,7 +14,6 @@ # from keystoneauth1 import session -import six from openstackclient.api import object_store_v1 as object_store from openstackclient.tests.unit import utils @@ -68,7 +67,7 @@ OBJECT = { 'last_modified': object_modified_1, } -object_1_content = six.b('object 1 content') +object_1_content = b'object 1 content' OBJECT_2 = { 'name': object_name_2, diff --git a/openstackclient/tests/unit/object/v1/test_object_all.py b/openstackclient/tests/unit/object/v1/test_object_all.py index dd587142..7e88409f 100644 --- a/openstackclient/tests/unit/object/v1/test_object_all.py +++ b/openstackclient/tests/unit/object/v1/test_object_all.py @@ -12,11 +12,11 @@ # import copy +import io from unittest import mock from osc_lib import exceptions from requests_mock.contrib import fixture -import six from openstackclient.object.v1 import object as object_cmds from openstackclient.tests.unit.object.v1 import fakes as object_fakes @@ -241,9 +241,9 @@ class TestObjectSave(TestObjectAll): parsed_args = self.check_parser(self.cmd, arglist, verifylist) - class FakeStdout(six.BytesIO): + class FakeStdout(io.BytesIO): def __init__(self): - six.BytesIO.__init__(self) + io.BytesIO.__init__(self) self.context_manager_calls = [] def __enter__(self): |
