mgr/dashboard/qa: add isort check

Add isort check to the QA test files and
fix issues.

Fixes: https://tracker.ceph.com/issues/47757
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
This commit is contained in:
Tatjana Dehler 2020-10-12 15:58:17 +02:00
parent bc3d1997bd
commit 1474259b65
14 changed files with 16 additions and 18 deletions

View File

@ -4,14 +4,12 @@ from __future__ import absolute_import
import json
import logging
from collections import namedtuple
import time
from collections import namedtuple
import requests
from teuthology.exceptions import CommandFailedError
from tasks.mgr.mgr_test_case import MgrTestCase
from teuthology.exceptions import CommandFailedError
log = logging.getLogger(__name__)

View File

@ -6,7 +6,7 @@ import time
import jwt
from .helper import DashboardTestCase, JObj, JLeaf
from .helper import DashboardTestCase, JLeaf, JObj
class AuthTest(DashboardTestCase):

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from contextlib import contextmanager
from .helper import DashboardTestCase, JObj, JList, JLeaf
from .helper import DashboardTestCase, JLeaf, JList, JObj
class CephfsTest(DashboardTestCase):

View File

@ -2,7 +2,7 @@
from __future__ import absolute_import
from .helper import DashboardTestCase, JObj, JList
from .helper import DashboardTestCase, JList, JObj
class CrushRuleTest(DashboardTestCase):

View File

@ -2,7 +2,7 @@
from __future__ import absolute_import
from .helper import DashboardTestCase, JObj, JList
from .helper import DashboardTestCase, JList, JObj
class ECPTest(DashboardTestCase):

View File

@ -3,7 +3,6 @@
from __future__ import absolute_import
from .helper import DashboardTestCase, JList, JObj

View File

@ -2,9 +2,10 @@
from __future__ import absolute_import
import logging
import requests
from .helper import DashboardTestCase, JAny, JObj, JList, JLeaf
from .helper import DashboardTestCase, JAny, JLeaf, JList, JObj
logger = logging.getLogger(__name__)

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
from .helper import DashboardTestCase
test_data = {
'inventory': [
{

View File

@ -4,7 +4,7 @@ from __future__ import absolute_import
import json
from .helper import DashboardTestCase, JObj, JAny, JList, JLeaf, JTuple
from .helper import DashboardTestCase, JAny, JLeaf, JList, JObj, JTuple
class OsdTest(DashboardTestCase):

View File

@ -5,7 +5,7 @@ from __future__ import absolute_import
import time
from .helper import DashboardTestCase, JObj, JLeaf, JList
from .helper import DashboardTestCase, JLeaf, JList, JObj
class RbdTest(DashboardTestCase):

View File

@ -4,14 +4,13 @@ from __future__ import absolute_import
import base64
import logging
import time
from urllib import parse
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.twofactor.totp import TOTP
from cryptography.hazmat.primitives.hashes import SHA1
from cryptography.hazmat.primitives.twofactor.totp import TOTP
from .helper import DashboardTestCase, JObj, JList, JLeaf
from .helper import DashboardTestCase, JLeaf, JList, JObj
logger = logging.getLogger(__name__)

View File

@ -2,7 +2,7 @@
from __future__ import absolute_import
from .helper import DashboardTestCase, JList, JObj, JAny
from .helper import DashboardTestCase, JAny, JList, JObj
class SettingsTest(DashboardTestCase):

View File

@ -3,7 +3,6 @@
from __future__ import absolute_import
import time
from datetime import datetime, timedelta
from .helper import DashboardTestCase

View File

@ -107,6 +107,7 @@ commands =
flake8
flake8 --config=tox.ini ../../../../qa/tasks/mgr/dashboard
isort . --check
isort ../../../../qa/tasks/mgr/dashboard --check
{[base-pylint]commands}
{[base-rst]commands}
@ -148,6 +149,7 @@ commands =
python --version
autopep8 {[autopep8]addopts} {posargs:.}
isort .
isort ../../../../qa/tasks/mgr/dashboard
[testenv:check]
commands =