summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2020-06-02 16:58:53 -0500
committerEric Harney <eharney@redhat.com>2021-03-10 15:04:27 -0500
commit82f0ceb724e93ccf22140762c65da88c9c2f4bb4 (patch)
tree1e6c3efb8abadfa6f0fdb4f3df568193ad79fdba /cinderclient/tests/unit
parent7a0d07c16d20fcb1e12368aa0ec20e2f53130f3a (diff)
downloadpython-cinderclient-82f0ceb724e93ccf22140762c65da88c9c2f4bb4.tar.gz
Add flake8-import-order extension
This adds the import order extension to match what we have in the cinder repo. This is a linting extension that will check that imports are in the correct order and the correct grouping so they automatically get flagged, and it won't be whether reviewers notice and decide to do anything or not. Cinder change was Ic13ba238a4a45c6219f4de131cfe0366219d722f for a little more wordy reasoning. Also includes updates for noqa tags. Newer version of the linters appear to want these on the function definition line, not on the decorator line. Change-Id: Ibf3f3afbf3bb6ec6613b35f91d4a353c6a391f41 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Diffstat (limited to 'cinderclient/tests/unit')
-rw-r--r--cinderclient/tests/unit/fake_actions_module.py4
-rw-r--r--cinderclient/tests/unit/test_utils.py4
-rw-r--r--cinderclient/tests/unit/v2/contrib/test_list_extensions.py4
-rw-r--r--cinderclient/tests/unit/v2/fakes.py1
-rw-r--r--cinderclient/tests/unit/v2/test_capabilities.py3
-rw-r--r--cinderclient/tests/unit/v2/test_pools.py3
-rw-r--r--cinderclient/tests/unit/v2/test_shell.py2
-rw-r--r--cinderclient/tests/unit/v2/test_type_access.py3
-rw-r--r--cinderclient/tests/unit/v2/test_types.py3
-rw-r--r--cinderclient/tests/unit/v3/fakes.py3
-rw-r--r--cinderclient/tests/unit/v3/test_clusters.py4
-rw-r--r--cinderclient/tests/unit/v3/test_group_types.py3
-rw-r--r--cinderclient/tests/unit/v3/test_services.py3
-rw-r--r--cinderclient/tests/unit/v3/test_shell.py7
14 files changed, 18 insertions, 29 deletions
diff --git a/cinderclient/tests/unit/fake_actions_module.py b/cinderclient/tests/unit/fake_actions_module.py
index 07e7d29..a2c4bf7 100644
--- a/cinderclient/tests/unit/fake_actions_module.py
+++ b/cinderclient/tests/unit/fake_actions_module.py
@@ -26,8 +26,8 @@ def do_fake_action():
return "fake_action 3.0 to 3.1"
-@api_versions.wraps("3.2", "3.3") # noqa: F811
-def do_fake_action(): # noqa
+@api_versions.wraps("3.2", "3.3")
+def do_fake_action(): # noqa: F811
return "fake_action 3.2 to 3.3"
diff --git a/cinderclient/tests/unit/test_utils.py b/cinderclient/tests/unit/test_utils.py
index a9636db..1fb9433 100644
--- a/cinderclient/tests/unit/test_utils.py
+++ b/cinderclient/tests/unit/test_utils.py
@@ -70,8 +70,8 @@ class FakeManagerWithApi(base.Manager):
def return_api_version(self):
return '3.1'
- @api_versions.wraps('3.2') # noqa: F811
- def return_api_version(self): # noqa
+ @api_versions.wraps('3.2')
+ def return_api_version(self): # noqa: F811
return '3.2'
diff --git a/cinderclient/tests/unit/v2/contrib/test_list_extensions.py b/cinderclient/tests/unit/v2/contrib/test_list_extensions.py
index 313b6ef..4b6100f 100644
--- a/cinderclient/tests/unit/v2/contrib/test_list_extensions.py
+++ b/cinderclient/tests/unit/v2/contrib/test_list_extensions.py
@@ -15,11 +15,9 @@
# under the License.
from cinderclient import extension
-from cinderclient.v2.contrib import list_extensions
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v2 import fakes
-
+from cinderclient.v2.contrib import list_extensions
extensions = [
extension.Extension(list_extensions.__name__.split(".")[-1],
diff --git a/cinderclient/tests/unit/v2/fakes.py b/cinderclient/tests/unit/v2/fakes.py
index 99a87d0..4c09e9d 100644
--- a/cinderclient/tests/unit/v2/fakes.py
+++ b/cinderclient/tests/unit/v2/fakes.py
@@ -13,7 +13,6 @@
# limitations under the License.
from datetime import datetime
-
from urllib import parse as urlparse
from cinderclient import client as base_client
diff --git a/cinderclient/tests/unit/v2/test_capabilities.py b/cinderclient/tests/unit/v2/test_capabilities.py
index 01a132d..98d8d71 100644
--- a/cinderclient/tests/unit/v2/test_capabilities.py
+++ b/cinderclient/tests/unit/v2/test_capabilities.py
@@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-from cinderclient.v2.capabilities import Capabilities
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v2 import fakes
+from cinderclient.v2.capabilities import Capabilities
cs = fakes.FakeClient()
diff --git a/cinderclient/tests/unit/v2/test_pools.py b/cinderclient/tests/unit/v2/test_pools.py
index 543e316..e909871 100644
--- a/cinderclient/tests/unit/v2/test_pools.py
+++ b/cinderclient/tests/unit/v2/test_pools.py
@@ -13,10 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-from cinderclient.v2.pools import Pool
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v2 import fakes
+from cinderclient.v2.pools import Pool
cs = fakes.FakeClient()
diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py
index f54846e..78ecf74 100644
--- a/cinderclient/tests/unit/v2/test_shell.py
+++ b/cinderclient/tests/unit/v2/test_shell.py
@@ -14,11 +14,11 @@
# under the License.
from unittest import mock
+from urllib import parse
import ddt
import fixtures
from requests_mock.contrib import fixture as requests_mock_fixture
-from urllib import parse
from cinderclient import client
from cinderclient import exceptions
diff --git a/cinderclient/tests/unit/v2/test_type_access.py b/cinderclient/tests/unit/v2/test_type_access.py
index 35a4480..d904c1d 100644
--- a/cinderclient/tests/unit/v2/test_type_access.py
+++ b/cinderclient/tests/unit/v2/test_type_access.py
@@ -14,10 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-from cinderclient.v2 import volume_type_access
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v2 import fakes
+from cinderclient.v2 import volume_type_access
cs = fakes.FakeClient()
diff --git a/cinderclient/tests/unit/v2/test_types.py b/cinderclient/tests/unit/v2/test_types.py
index 9ba13a9..cf13723 100644
--- a/cinderclient/tests/unit/v2/test_types.py
+++ b/cinderclient/tests/unit/v2/test_types.py
@@ -14,10 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-from cinderclient.v2 import volume_types
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v2 import fakes
+from cinderclient.v2 import volume_types
cs = fakes.FakeClient()
diff --git a/cinderclient/tests/unit/v3/fakes.py b/cinderclient/tests/unit/v3/fakes.py
index 3fb6a36..7647fb3 100644
--- a/cinderclient/tests/unit/v3/fakes.py
+++ b/cinderclient/tests/unit/v3/fakes.py
@@ -14,10 +14,9 @@
from datetime import datetime
-from cinderclient.v3 import client
-
from cinderclient.tests.unit import fakes
from cinderclient.tests.unit.v2 import fakes as fake_v2
+from cinderclient.v3 import client
fake_attachment = {'attachment': {
diff --git a/cinderclient/tests/unit/v3/test_clusters.py b/cinderclient/tests/unit/v3/test_clusters.py
index c2045b6..21b560d 100644
--- a/cinderclient/tests/unit/v3/test_clusters.py
+++ b/cinderclient/tests/unit/v3/test_clusters.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
+import ddt
+
from cinderclient import api_versions
from cinderclient import exceptions as exc
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v3 import fakes
-import ddt
-
cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.7'))
diff --git a/cinderclient/tests/unit/v3/test_group_types.py b/cinderclient/tests/unit/v3/test_group_types.py
index 5833c3f..2263d0e 100644
--- a/cinderclient/tests/unit/v3/test_group_types.py
+++ b/cinderclient/tests/unit/v3/test_group_types.py
@@ -16,10 +16,9 @@
from cinderclient import api_versions
from cinderclient import exceptions as exc
-from cinderclient.v3 import group_types
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v3 import fakes
+from cinderclient.v3 import group_types
cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.11'))
pre_cs = fakes.FakeClient(api_version=api_versions.APIVersion('3.10'))
diff --git a/cinderclient/tests/unit/v3/test_services.py b/cinderclient/tests/unit/v3/test_services.py
index 0715cd3..8af3682 100644
--- a/cinderclient/tests/unit/v3/test_services.py
+++ b/cinderclient/tests/unit/v3/test_services.py
@@ -14,10 +14,9 @@
# under the License.
from cinderclient import api_versions
-from cinderclient.v3 import services
-
from cinderclient.tests.unit import utils
from cinderclient.tests.unit.v3 import fakes
+from cinderclient.v3 import services
class ServicesTest(utils.TestCase):
diff --git a/cinderclient/tests/unit/v3/test_shell.py b/cinderclient/tests/unit/v3/test_shell.py
index 82e3943..756f512 100644
--- a/cinderclient/tests/unit/v3/test_shell.py
+++ b/cinderclient/tests/unit/v3/test_shell.py
@@ -51,15 +51,14 @@ from cinderclient import base
from cinderclient import client
from cinderclient import exceptions
from cinderclient import shell
+from cinderclient.tests.unit.fixture_data import keystone_client
+from cinderclient.tests.unit import utils
+from cinderclient.tests.unit.v3 import fakes
from cinderclient import utils as cinderclient_utils
from cinderclient.v3 import attachments
from cinderclient.v3 import volume_snapshots
from cinderclient.v3 import volumes
-from cinderclient.tests.unit.fixture_data import keystone_client
-from cinderclient.tests.unit import utils
-from cinderclient.tests.unit.v3 import fakes
-
@ddt.ddt
@mock.patch.object(client, 'Client', fakes.FakeClient)