From 9ddf2f7108ad1e81cc8969df87433f6f79ec005b Mon Sep 17 00:00:00 2001 From: songwenping Date: Tue, 19 Apr 2022 11:25:47 +0800 Subject: Remove usage of six Six package is not used anymore Change-Id: Ie72645229f23692d6bf87e58dd8ef212dd91189c --- saharaclient/api/base.py | 2 +- saharaclient/api/clusters.py | 2 +- saharaclient/api/job_binary_internals.py | 2 +- saharaclient/api/plugins.py | 2 +- saharaclient/tests/unit/osc/v1/test_job_binaries.py | 6 +++--- saharaclient/tests/unit/osc/v1/test_job_types.py | 4 ++-- saharaclient/tests/unit/osc/v1/test_plugins.py | 4 ++-- saharaclient/tests/unit/osc/v2/test_job_binaries.py | 4 ++-- saharaclient/tests/unit/osc/v2/test_job_types.py | 4 ++-- saharaclient/tests/unit/osc/v2/test_plugins.py | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) (limited to 'saharaclient') diff --git a/saharaclient/api/base.py b/saharaclient/api/base.py index 237307c..fa1759f 100644 --- a/saharaclient/api/base.py +++ b/saharaclient/api/base.py @@ -16,7 +16,7 @@ import copy from oslo_serialization import jsonutils -from six.moves.urllib import parse +from urllib import parse from saharaclient._i18n import _ diff --git a/saharaclient/api/clusters.py b/saharaclient/api/clusters.py index 49f9b28..c36e6c1 100644 --- a/saharaclient/api/clusters.py +++ b/saharaclient/api/clusters.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six.moves.urllib import parse +from urllib import parse from saharaclient.api import base diff --git a/saharaclient/api/job_binary_internals.py b/saharaclient/api/job_binary_internals.py index 8017846..5db17d6 100644 --- a/saharaclient/api/job_binary_internals.py +++ b/saharaclient/api/job_binary_internals.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six.moves.urllib import parse as urlparse +from urllib import parse as urlparse from saharaclient.api import base diff --git a/saharaclient/api/plugins.py b/saharaclient/api/plugins.py index fe7d488..b7a0545 100644 --- a/saharaclient/api/plugins.py +++ b/saharaclient/api/plugins.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six.moves.urllib import parse as urlparse +from urllib import parse as urlparse from saharaclient.api import base diff --git a/saharaclient/tests/unit/osc/v1/test_job_binaries.py b/saharaclient/tests/unit/osc/v1/test_job_binaries.py index 96da3c3..cf643aa 100644 --- a/saharaclient/tests/unit/osc/v1/test_job_binaries.py +++ b/saharaclient/tests/unit/osc/v1/test_job_binaries.py @@ -84,7 +84,7 @@ class TestCreateJobBinary(TestJobBinaries): def test_job_binary_create_internal(self): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['--name', 'job-binary', '--data', 'filepath'] verifylist = [('name', 'job-binary'), ('data', 'filepath')] @@ -310,7 +310,7 @@ class TestDownloadJobBinary(TestJobBinaries): def test_download_job_binary_default_file(self): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['job-binary'] verifylist = [('job_binary', 'job-binary')] @@ -327,7 +327,7 @@ class TestDownloadJobBinary(TestJobBinaries): def test_download_job_binary_specified_file(self): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['job-binary', '--file', 'test'] verifylist = [('job_binary', 'job-binary'), ('file', 'test')] diff --git a/saharaclient/tests/unit/osc/v1/test_job_types.py b/saharaclient/tests/unit/osc/v1/test_job_types.py index 8d1a319..80eed6a 100644 --- a/saharaclient/tests/unit/osc/v1/test_job_types.py +++ b/saharaclient/tests/unit/osc/v1/test_job_types.py @@ -105,7 +105,7 @@ class TestGetJobTypeConfigs(TestJobTypes): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_job_type_configs_default_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['Pig'] verifylist = [('job_type', 'Pig')] @@ -127,7 +127,7 @@ class TestGetJobTypeConfigs(TestJobTypes): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_job_type_configs_specified_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open): + with mock.patch('builtins.open', m_open): arglist = ['Pig', '--file', 'testfile'] verifylist = [('job_type', 'Pig'), ('file', 'testfile')] diff --git a/saharaclient/tests/unit/osc/v1/test_plugins.py b/saharaclient/tests/unit/osc/v1/test_plugins.py index 75c49b1..a39f93b 100644 --- a/saharaclient/tests/unit/osc/v1/test_plugins.py +++ b/saharaclient/tests/unit/osc/v1/test_plugins.py @@ -156,7 +156,7 @@ class TestGetPluginConfigs(TestPlugins): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_plugin_configs_default_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['fake', '0.1'] verifylist = [('plugin', 'fake'), ('plugin_version', '0.1')] @@ -178,7 +178,7 @@ class TestGetPluginConfigs(TestPlugins): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_plugin_configs_specified_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open): + with mock.patch('builtins.open', m_open): arglist = ['fake', '0.1', '--file', 'testfile'] verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('file', 'testfile')] diff --git a/saharaclient/tests/unit/osc/v2/test_job_binaries.py b/saharaclient/tests/unit/osc/v2/test_job_binaries.py index 93d889a..c86c3ca 100644 --- a/saharaclient/tests/unit/osc/v2/test_job_binaries.py +++ b/saharaclient/tests/unit/osc/v2/test_job_binaries.py @@ -293,7 +293,7 @@ class TestDownloadJobBinary(TestJobBinaries): def test_download_job_binary_default_file(self): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['job-binary'] verifylist = [('job_binary', 'job-binary')] @@ -310,7 +310,7 @@ class TestDownloadJobBinary(TestJobBinaries): def test_download_job_binary_specified_file(self): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['job-binary', '--file', 'test'] verifylist = [('job_binary', 'job-binary'), ('file', 'test')] diff --git a/saharaclient/tests/unit/osc/v2/test_job_types.py b/saharaclient/tests/unit/osc/v2/test_job_types.py index 477f147..c6ea129 100644 --- a/saharaclient/tests/unit/osc/v2/test_job_types.py +++ b/saharaclient/tests/unit/osc/v2/test_job_types.py @@ -106,7 +106,7 @@ class TestGetJobTypeConfigs(TestJobTypes): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_job_type_configs_default_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['Pig'] verifylist = [('job_type', 'Pig')] @@ -128,7 +128,7 @@ class TestGetJobTypeConfigs(TestJobTypes): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_job_type_configs_specified_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open): + with mock.patch('builtins.open', m_open): arglist = ['Pig', '--file', 'testfile'] verifylist = [('job_type', 'Pig'), ('file', 'testfile')] diff --git a/saharaclient/tests/unit/osc/v2/test_plugins.py b/saharaclient/tests/unit/osc/v2/test_plugins.py index ae72e83..3800fcb 100644 --- a/saharaclient/tests/unit/osc/v2/test_plugins.py +++ b/saharaclient/tests/unit/osc/v2/test_plugins.py @@ -156,7 +156,7 @@ class TestGetPluginConfigs(TestPlugins): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_plugin_configs_default_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open, create=True): + with mock.patch('builtins.open', m_open, create=True): arglist = ['fake', '0.1'] verifylist = [('plugin', 'fake'), ('plugin_version', '0.1')] @@ -178,7 +178,7 @@ class TestGetPluginConfigs(TestPlugins): @mock.patch('oslo_serialization.jsonutils.dump') def test_get_plugin_configs_specified_file(self, p_dump): m_open = mock.mock_open() - with mock.patch('six.moves.builtins.open', m_open): + with mock.patch('builtins.open', m_open): arglist = ['fake', '0.1', '--file', 'testfile'] verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('file', 'testfile')] -- cgit v1.2.1