summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openstack_auth/backend.py1
-rw-r--r--openstack_auth/tests/data_v2.py1
-rw-r--r--openstack_auth/tests/data_v3.py4
-rw-r--r--openstack_auth/tests/run_tests.py2
-rw-r--r--openstack_auth/tests/tests.py19
-rw-r--r--openstack_auth/user.py1
-rw-r--r--openstack_auth/utils.py4
-rw-r--r--openstack_auth/views.py1
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini4
10 files changed, 16 insertions, 23 deletions
diff --git a/openstack_auth/backend.py b/openstack_auth/backend.py
index f941ad3..1d56103 100644
--- a/openstack_auth/backend.py
+++ b/openstack_auth/backend.py
@@ -17,7 +17,6 @@ import logging
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
-
from keystoneclient import exceptions as keystone_exceptions
from openstack_auth import exceptions
diff --git a/openstack_auth/tests/data_v2.py b/openstack_auth/tests/data_v2.py
index 797f1ed..08834fe 100644
--- a/openstack_auth/tests/data_v2.py
+++ b/openstack_auth/tests/data_v2.py
@@ -15,7 +15,6 @@ import datetime
import uuid
from django.utils import datetime_safe
-
from keystoneclient import access
from keystoneclient import service_catalog
from keystoneclient.v2_0 import roles
diff --git a/openstack_auth/tests/data_v3.py b/openstack_auth/tests/data_v3.py
index be7fa04..be95b15 100644
--- a/openstack_auth/tests/data_v3.py
+++ b/openstack_auth/tests/data_v3.py
@@ -14,16 +14,14 @@
import datetime
import uuid
-import requests
-
from django.utils import datetime_safe
-
from keystoneclient import access
from keystoneclient import service_catalog
from keystoneclient.v3 import domains
from keystoneclient.v3 import projects
from keystoneclient.v3 import roles
from keystoneclient.v3 import users
+import requests
class TestDataContainer(object):
diff --git a/openstack_auth/tests/run_tests.py b/openstack_auth/tests/run_tests.py
index 46c474c..32ec848 100644
--- a/openstack_auth/tests/run_tests.py
+++ b/openstack_auth/tests/run_tests.py
@@ -19,9 +19,9 @@ import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_auth.tests.settings'
+import django
from django.test import simple as test_simple
-import django
if hasattr(django, 'setup'):
django.setup()
diff --git a/openstack_auth/tests/tests.py b/openstack_auth/tests/tests.py
index 17e98a1..b0edf17 100644
--- a/openstack_auth/tests/tests.py
+++ b/openstack_auth/tests/tests.py
@@ -13,16 +13,15 @@
import copy
-from mox3 import mox
-
from django.conf import settings
from django.contrib import auth
from django.core.urlresolvers import reverse
from django import test
-
from keystoneclient import exceptions as keystone_exceptions
from keystoneclient.v2_0 import client as client_v2
from keystoneclient.v3 import client as client_v3
+from mox3 import mox
+import six
from openstack_auth.tests import data_v2
from openstack_auth.tests import data_v3
@@ -445,26 +444,26 @@ def EndpointMetaFactory(endpoint_type):
# wrap each test with OPENSTACK_ENDPOINT_TYPE parameter set/restore
def __new__(cls, name, bases, attrs):
base, = bases
- for k, v in base.__dict__.iteritems():
+ for k, v in six.iteritems(base.__dict__):
if not k.startswith('__') and getattr(v, '__call__', None):
attrs[k] = endpoint_wrapper(v)
return super(EndPointMeta, cls).__new__(cls, name, bases, attrs)
return EndPointMeta
+@six.add_metaclass(EndpointMetaFactory('publicURL'))
class OpenStackAuthTestsV2WithPublicURL(OpenStackAuthTestsV2):
"""Test V2 with settings.OPENSTACK_ENDPOINT_TYPE = 'publicURL'."""
- __metaclass__ = EndpointMetaFactory('publicURL')
+@six.add_metaclass(EndpointMetaFactory('internalURL'))
class OpenStackAuthTestsV2WithInternalURL(OpenStackAuthTestsV2):
"""Test V2 with settings.OPENSTACK_ENDPOINT_TYPE = 'internalURL'."""
- __metaclass__ = EndpointMetaFactory('internalURL')
+@six.add_metaclass(EndpointMetaFactory('adminURL'))
class OpenStackAuthTestsV2WithAdminURL(OpenStackAuthTestsV2):
"""Test V2 with settings.OPENSTACK_ENDPOINT_TYPE = 'adminURL'."""
- __metaclass__ = EndpointMetaFactory('adminURL')
class OpenStackAuthTestsV3(OpenStackAuthTestsMixin, test.TestCase):
@@ -776,16 +775,16 @@ class OpenStackAuthTestsV3(OpenStackAuthTestsMixin, test.TestCase):
self.assertIsNone(utils._PROJECT_CACHE.get(unscoped.auth_token))
+@six.add_metaclass(EndpointMetaFactory('publicURL'))
class OpenStackAuthTestsV3WithPublicURL(OpenStackAuthTestsV3):
"""Test V3 with settings.OPENSTACK_ENDPOINT_TYPE = 'publicURL'."""
- __metaclass__ = EndpointMetaFactory('publicURL')
+@six.add_metaclass(EndpointMetaFactory('internalURL'))
class OpenStackAuthTestsV3WithInternalURL(OpenStackAuthTestsV3):
"""Test V3 with settings.OPENSTACK_ENDPOINT_TYPE = 'internalURL'."""
- __metaclass__ = EndpointMetaFactory('internalURL')
+@six.add_metaclass(EndpointMetaFactory('adminURL'))
class OpenStackAuthTestsV3WithAdminURL(OpenStackAuthTestsV3):
"""Test V3 with settings.OPENSTACK_ENDPOINT_TYPE = 'adminURL'."""
- __metaclass__ = EndpointMetaFactory('adminURL')
diff --git a/openstack_auth/user.py b/openstack_auth/user.py
index bdcf5ba..7abd8e4 100644
--- a/openstack_auth/user.py
+++ b/openstack_auth/user.py
@@ -16,7 +16,6 @@ import logging
from django.conf import settings
from django.contrib.auth import models
-
from keystoneclient import exceptions as keystone_exceptions
from openstack_auth import utils
diff --git a/openstack_auth/utils.py b/openstack_auth/utils.py
index f41985c..6a0d73b 100644
--- a/openstack_auth/utils.py
+++ b/openstack_auth/utils.py
@@ -14,17 +14,15 @@
import datetime
import functools
-from six.moves.urllib import parse as urlparse
-
from django.conf import settings
from django.contrib import auth
from django.contrib.auth import middleware
from django.contrib.auth import models
from django.utils import decorators
from django.utils import timezone
-
from keystoneclient.v2_0 import client as client_v2
from keystoneclient.v3 import client as client_v3
+from six.moves.urllib import parse as urlparse
_PROJECT_CACHE = {}
diff --git a/openstack_auth/views.py b/openstack_auth/views.py
index 00aff6a..e7ea1e8 100644
--- a/openstack_auth/views.py
+++ b/openstack_auth/views.py
@@ -24,7 +24,6 @@ from django.utils import http
from django.views.decorators.cache import never_cache # noqa
from django.views.decorators.csrf import csrf_protect # noqa
from django.views.decorators.debug import sensitive_post_parameters # noqa
-
from keystoneclient import exceptions as keystone_exceptions
from keystoneclient.v2_0 import client as keystone_client_v2
diff --git a/test-requirements.txt b/test-requirements.txt
index be0da50..f62a736 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-hacking>=0.8.0,<0.9
+hacking>=0.9.2,<0.10
Babel>=1.3
coverage>=3.6
mox3>=0.7.0
diff --git a/tox.ini b/tox.ini
index 2f75ac5..9e1bdd9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -41,8 +41,10 @@ downloadcache = ~/cache/pip
[flake8]
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py
+# H405 multi line docstring summary not separated with an empty line
# H803 git commit title should not end with period (disabled on purpose, see bug #1236621)
-ignore = H803
+# H904 Wrap long lines in parentheses instead of a backslash
+ignore = H405,H803,H904
[hacking]
import_exceptions = django.conf.settings,