From 08a223a0d03dbb5b0855b3108573c2eb647b1154 Mon Sep 17 00:00:00 2001 From: Eric Guo Date: Fri, 17 Jan 2014 20:13:24 +0800 Subject: [PATCH] Adjust import items according to hacking import rule This patch adjust import items and add missing blank lines acording to http://docs.openstack.org/developer/hacking/#imports {{stdlib imports in human alphabetical order}} \n {{third-party lib imports in human alphabetical order}} \n {{project imports in human alphabetical order}} \n \n {{begin your code}} hacking project also enforce some checks for import group. Let make the change in keytoneclient Change-Id: Ic83bd5ee426905588f4a2d555851a9a01fc69f02 --- test_auth_token_middleware.py | 4 ++-- test_discovery.py | 1 + test_http.py | 4 +++- test_https.py | 2 +- test_keyring.py | 1 + v2_0/test_access.py | 1 + v2_0/utils.py | 1 + v3/test_access.py | 1 + v3/utils.py | 1 + 9 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test_auth_token_middleware.py b/test_auth_token_middleware.py index c463e51..48d58ef 100644 --- a/test_auth_token_middleware.py +++ b/test_auth_token_middleware.py @@ -16,20 +16,20 @@ import calendar import datetime -import iso8601 import os import shutil import stat import sys import tempfile -import testtools import time import uuid import fixtures import httpretty +import iso8601 import mock import testresources +import testtools import webob from keystoneclient.common import cms diff --git a/test_discovery.py b/test_discovery.py index 2a3e7e8..516c746 100644 --- a/test_discovery.py +++ b/test_discovery.py @@ -23,6 +23,7 @@ from keystoneclient.tests import utils from keystoneclient.v2_0 import client as v2_client from keystoneclient.v3 import client as v3_client + BASE_HOST = 'http://keystone.example.com' BASE_URL = "%s:5000/" % BASE_HOST UPDATED = '2013-03-06T00:00:00Z' diff --git a/test_http.py b/test_http.py index 85bdc68..a5110a4 100644 --- a/test_http.py +++ b/test_http.py @@ -14,8 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. -import httpretty import logging + +import httpretty import six from testtools import matchers @@ -24,6 +25,7 @@ from keystoneclient import httpclient from keystoneclient import session from keystoneclient.tests import utils + RESPONSE_BODY = '{"hi": "there"}' diff --git a/test_https.py b/test_https.py index b4a955b..ee47e85 100644 --- a/test_https.py +++ b/test_https.py @@ -13,13 +13,13 @@ # under the License. import mock - import requests from keystoneclient import httpclient from keystoneclient import session from keystoneclient.tests import utils + FAKE_RESPONSE = utils.TestResponse({ "status_code": 200, "text": '{"hi": "there"}', diff --git a/test_keyring.py b/test_keyring.py index a44d432..f5d23b8 100644 --- a/test_keyring.py +++ b/test_keyring.py @@ -28,6 +28,7 @@ try: except ImportError: keyring = None + PROJECT_SCOPED_TOKEN = client_fixtures.PROJECT_SCOPED_TOKEN # These mirror values from PROJECT_SCOPED_TOKEN diff --git a/v2_0/test_access.py b/v2_0/test_access.py index 6aacf2d..ea2428e 100644 --- a/v2_0/test_access.py +++ b/v2_0/test_access.py @@ -22,6 +22,7 @@ from keystoneclient.tests import client_fixtures as token_data from keystoneclient.tests.v2_0 import client_fixtures from keystoneclient.tests.v2_0 import utils + UNSCOPED_TOKEN = client_fixtures.UNSCOPED_TOKEN PROJECT_SCOPED_TOKEN = client_fixtures.PROJECT_SCOPED_TOKEN diff --git a/v2_0/utils.py b/v2_0/utils.py index 238543f..c5e0ee5 100644 --- a/v2_0/utils.py +++ b/v2_0/utils.py @@ -17,6 +17,7 @@ import httpretty from keystoneclient.tests import utils from keystoneclient.v2_0 import client + TestResponse = utils.TestResponse diff --git a/v3/test_access.py b/v3/test_access.py index 1ade338..bc7ada9 100644 --- a/v3/test_access.py +++ b/v3/test_access.py @@ -19,6 +19,7 @@ from keystoneclient.openstack.common import timeutils from keystoneclient.tests.v3 import client_fixtures from keystoneclient.tests.v3 import utils + TOKEN_RESPONSE = utils.TestResponse({ "headers": client_fixtures.AUTH_RESPONSE_HEADERS }) diff --git a/v3/utils.py b/v3/utils.py index 1935691..620c0f5 100644 --- a/v3/utils.py +++ b/v3/utils.py @@ -21,6 +21,7 @@ from keystoneclient.openstack.common import jsonutils from keystoneclient.tests import utils from keystoneclient.v3 import client + TestResponse = utils.TestResponse