Bump hacking to 0.9.x series

In order to sync global-requirements, this patch bumps
hacking to 0.9.x series.
H236, H305, H307 errors are fixed in this patch.
H307 and H904 are added to the ignore list.

Change-Id: I37c16ad67912dec8ce1562676ae0ebbfbe277d99
This commit is contained in:
Akihiro Motoki 2014-10-19 04:44:57 +09:00
parent b1c4cd6248
commit 2e5485d8c5
10 changed files with 16 additions and 23 deletions

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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()

View File

@ -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')

View File

@ -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

View File

@ -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 = {}

View File

@ -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

View File

@ -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

View File

@ -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,