Check for Google import order style in flake8
This commit is contained in:
@@ -5,10 +5,8 @@
|
||||
#
|
||||
|
||||
import os
|
||||
from pkg_resources import get_distribution
|
||||
import sys
|
||||
|
||||
import mock
|
||||
|
||||
# In order to load django before 1.7, we need to create a faux
|
||||
# settings module and load it. This assumes django has been installed
|
||||
@@ -16,6 +14,8 @@ import mock
|
||||
# been installed run `pip install -r docs/requirements.txt`.
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.contrib.test_django_settings'
|
||||
import django
|
||||
import mock
|
||||
from pkg_resources import get_distribution
|
||||
if django.VERSION[1] < 7:
|
||||
sys.path.insert(0, '.')
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import base64
|
||||
import json
|
||||
|
||||
import six
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
# limitations under the License.
|
||||
"""pyCrypto Crypto-related routines for oauth2client."""
|
||||
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Hash import SHA256
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Signature import PKCS1_v1_5
|
||||
from Crypto.Util.asn1 import DerSequence
|
||||
|
||||
|
||||
@@ -23,25 +23,26 @@ import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
import sys
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
import httplib2
|
||||
import six
|
||||
from six.moves import http_client
|
||||
from six.moves import urllib
|
||||
|
||||
import httplib2
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import GOOGLE_AUTH_URI
|
||||
from oauth2client import GOOGLE_DEVICE_URI
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import GOOGLE_TOKEN_INFO_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import util
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client._helpers import _urlsafe_b64decode
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import util
|
||||
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
@@ -19,8 +19,8 @@ an OAuth 2.0 protected service.
|
||||
"""
|
||||
|
||||
import json
|
||||
import six
|
||||
|
||||
import six
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
|
||||
@@ -13,9 +13,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import errno
|
||||
import time
|
||||
|
||||
import fcntl
|
||||
import time
|
||||
|
||||
from oauth2client.contrib.locked_file import _Opener
|
||||
from oauth2client.contrib.locked_file import AlreadyLockedException
|
||||
|
||||
@@ -18,15 +18,15 @@ See https://cloud.google.com/compute/docs/metadata
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
|
||||
import httplib2
|
||||
from six.moves import http_client
|
||||
from six.moves.urllib import parse as urlparse
|
||||
|
||||
from oauth2client import util
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client.client import _UTCNOW
|
||||
from oauth2client import util
|
||||
|
||||
|
||||
METADATA_ROOT = 'http://metadata.google.internal/computeMetadata/v1/'
|
||||
|
||||
@@ -24,19 +24,18 @@ import os
|
||||
import pickle
|
||||
import threading
|
||||
|
||||
import httplib2
|
||||
import webapp2 as webapp
|
||||
|
||||
from google.appengine.api import app_identity
|
||||
from google.appengine.api import memcache
|
||||
from google.appengine.api import users
|
||||
from google.appengine.ext import db
|
||||
from google.appengine.ext.webapp.util import login_required
|
||||
import httplib2
|
||||
import webapp2 as webapp
|
||||
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import GOOGLE_AUTH_URI
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import util
|
||||
from oauth2client.client import AccessTokenRefreshError
|
||||
from oauth2client.client import AssertionCredentials
|
||||
|
||||
@@ -19,8 +19,8 @@ import json
|
||||
import os
|
||||
import socket
|
||||
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client import client
|
||||
from oauth2client._helpers import _to_bytes
|
||||
|
||||
# Expose utcnow() at module level to allow for
|
||||
# easier testing (by replacing with a stub).
|
||||
|
||||
@@ -21,12 +21,13 @@ the Django datastore.
|
||||
Only Django versions 1.8+ are supported.
|
||||
"""
|
||||
|
||||
import oauth2client
|
||||
import base64
|
||||
import pickle
|
||||
|
||||
from django.db import models
|
||||
from django.utils.encoding import smart_bytes, smart_text
|
||||
|
||||
import oauth2client
|
||||
from oauth2client.client import Storage as BaseStorage
|
||||
|
||||
|
||||
|
||||
@@ -170,9 +170,10 @@ import django.conf
|
||||
from django.core import exceptions
|
||||
from django.core import urlresolvers
|
||||
import httplib2
|
||||
from six.moves.urllib import parse
|
||||
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client.contrib.django_util import storage
|
||||
from six.moves.urllib import parse
|
||||
|
||||
GOOGLE_OAUTH2_DEFAULT_SCOPES = ('email',)
|
||||
GOOGLE_OAUTH2_REQUEST_ATTRIBUTE = 'oauth'
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
# limitations under the License.
|
||||
|
||||
from django import shortcuts
|
||||
from oauth2client.contrib import django_util
|
||||
from six import wraps
|
||||
|
||||
from oauth2client.contrib import django_util
|
||||
|
||||
|
||||
def oauth_required(decorated_function=None, scopes=None, **decorator_kwargs):
|
||||
""" Decorator to require OAuth2 credentials for a view
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
from django.conf import urls
|
||||
|
||||
from oauth2client.contrib.django_util import views
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -16,9 +16,11 @@ import hashlib
|
||||
import json
|
||||
import os
|
||||
import pickle
|
||||
|
||||
from django import http
|
||||
from django.core import urlresolvers
|
||||
from django import shortcuts
|
||||
from django.core import urlresolvers
|
||||
|
||||
from oauth2client import client
|
||||
from oauth2client.contrib import django_util
|
||||
from oauth2client.contrib.django_util import signals
|
||||
|
||||
@@ -162,14 +162,11 @@ available outside of a request context, you will need to implement your own
|
||||
:class:`oauth2client.Storage`.
|
||||
"""
|
||||
|
||||
from functools import wraps
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import pickle
|
||||
from functools import wraps
|
||||
|
||||
import six.moves.http_client as httplib
|
||||
import httplib2
|
||||
|
||||
try:
|
||||
from flask import Blueprint
|
||||
@@ -182,10 +179,13 @@ try:
|
||||
except ImportError: # pragma: NO COVER
|
||||
raise ImportError('The flask utilities require flask 0.9 or newer.')
|
||||
|
||||
import httplib2
|
||||
import six.moves.http_client as httplib
|
||||
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client.client import FlowExchangeError
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.contrib.dictionary_storage import DictionaryStorage
|
||||
from oauth2client import clientsecrets
|
||||
|
||||
|
||||
__author__ = 'jonwayne@google.com (Jon Wayne Parrott)'
|
||||
|
||||
@@ -50,12 +50,11 @@ import logging
|
||||
import os
|
||||
import threading
|
||||
|
||||
from oauth2client import util
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import Storage as BaseStorage
|
||||
from oauth2client import util
|
||||
from oauth2client.contrib.locked_file import LockedFile
|
||||
|
||||
|
||||
__author__ = 'jbeda@google.com (Joe Beda)'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -90,9 +90,10 @@ We will reuse tables defined above.
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import oauth2client.client
|
||||
import sqlalchemy.types
|
||||
|
||||
import oauth2client.client
|
||||
|
||||
|
||||
class CredentialsType(sqlalchemy.types.PickleType):
|
||||
"""Type representing credentials.
|
||||
|
||||
@@ -19,8 +19,8 @@ import binascii
|
||||
import hmac
|
||||
import time
|
||||
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client import util
|
||||
from oauth2client._helpers import _to_bytes
|
||||
|
||||
__authors__ = [
|
||||
'"Doug Coker" <dcoker@google.com>',
|
||||
|
||||
@@ -17,23 +17,24 @@
|
||||
import base64
|
||||
import copy
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
import time
|
||||
|
||||
import httplib2
|
||||
|
||||
from oauth2client import crypt
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client import util
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client.client import _apply_user_agent
|
||||
from oauth2client.client import _initialize_headers
|
||||
from oauth2client.client import _UTCNOW
|
||||
from oauth2client.client import AccessTokenInfo
|
||||
from oauth2client.client import AssertionCredentials
|
||||
from oauth2client.client import clean_headers
|
||||
from oauth2client.client import EXPIRY_FORMAT
|
||||
from oauth2client.client import SERVICE_ACCOUNT
|
||||
from oauth2client.client import _UTCNOW
|
||||
from oauth2client import crypt
|
||||
|
||||
|
||||
_PASSWORD_DEFAULT = 'notasecret'
|
||||
|
||||
@@ -27,8 +27,8 @@ import sys
|
||||
|
||||
from six.moves import BaseHTTPServer
|
||||
from six.moves import http_client
|
||||
from six.moves import urllib
|
||||
from six.moves import input
|
||||
from six.moves import urllib
|
||||
|
||||
from oauth2client import client
|
||||
from oauth2client import util
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# See: https://developers.google.com/compute/docs/authentication
|
||||
|
||||
from googleapiclient.discovery import build
|
||||
|
||||
from oauth2client.client import GoogleCredentials
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# To be used to test GoogleCredentials.get_application_default()
|
||||
# from devel GAE (ie, dev_appserver.py).
|
||||
|
||||
import webapp2
|
||||
from googleapiclient.discovery import build
|
||||
import webapp2
|
||||
|
||||
from oauth2client.client import GoogleCredentials
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
# See: https://developers.google.com/accounts/docs/OAuth2ForDevices
|
||||
|
||||
from googleapiclient.discovery import build
|
||||
import httplib2
|
||||
from six.moves import input
|
||||
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from googleapiclient.discovery import build
|
||||
|
||||
CLIENT_ID = "some+client+id"
|
||||
CLIENT_SECRET = "some+client+secret"
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import unittest2
|
||||
|
||||
import httplib2
|
||||
from six.moves import http_client
|
||||
from six.moves import urllib
|
||||
import unittest2
|
||||
|
||||
from oauth2client import GOOGLE_TOKEN_INFO_URI
|
||||
from oauth2client.client import GoogleCredentials
|
||||
|
||||
@@ -17,6 +17,7 @@ import os
|
||||
|
||||
import httplib2
|
||||
from six.moves import http_client
|
||||
|
||||
from oauth2client import client
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
|
||||
|
||||
2
setup.py
2
setup.py
@@ -20,8 +20,10 @@ are not already installed.
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
import oauth2client
|
||||
|
||||
if sys.version_info < (2, 6):
|
||||
|
||||
@@ -13,21 +13,15 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
import os
|
||||
import tempfile
|
||||
import time
|
||||
import unittest2
|
||||
|
||||
from six.moves import urllib
|
||||
|
||||
import dev_appserver
|
||||
dev_appserver.fix_sys_path()
|
||||
import mock
|
||||
import webapp2
|
||||
|
||||
from ..http_mock import CacheMock
|
||||
dev_appserver.fix_sys_path()
|
||||
|
||||
from google.appengine.api import apiproxy_stub
|
||||
from google.appengine.api import apiproxy_stub_map
|
||||
from google.appengine.api import app_identity
|
||||
@@ -37,12 +31,25 @@ from google.appengine.api.memcache import memcache_stub
|
||||
from google.appengine.ext import db
|
||||
from google.appengine.ext import ndb
|
||||
from google.appengine.ext import testbed
|
||||
from oauth2client.contrib import appengine
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
import httplib2
|
||||
import mock
|
||||
from six.moves import urllib
|
||||
import unittest2
|
||||
import webapp2
|
||||
from webtest import TestApp
|
||||
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client.client import _CLOUDSDK_CONFIG_ENV_VAR
|
||||
from oauth2client.client import AccessTokenRefreshError
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import flow_from_clientsecrets
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from oauth2client.clientsecrets import _loadfile
|
||||
from oauth2client.clientsecrets import TYPE_WEB
|
||||
from oauth2client.clientsecrets import InvalidClientSecretsError
|
||||
from oauth2client.clientsecrets import TYPE_WEB
|
||||
from oauth2client.contrib import appengine
|
||||
from oauth2client.contrib.appengine import AppAssertionCredentials
|
||||
from oauth2client.contrib.appengine import CredentialsModel
|
||||
from oauth2client.contrib.appengine import CredentialsNDBModel
|
||||
@@ -51,17 +58,10 @@ from oauth2client.contrib.appengine import FlowProperty
|
||||
from oauth2client.contrib.appengine import (
|
||||
InvalidClientSecretsError as AppEngineInvalidClientSecretsError)
|
||||
from oauth2client.contrib.appengine import OAuth2Decorator
|
||||
from oauth2client.contrib.appengine import OAuth2DecoratorFromClientSecrets
|
||||
from oauth2client.contrib.appengine import oauth2decorator_from_clientsecrets
|
||||
from oauth2client.contrib.appengine import OAuth2DecoratorFromClientSecrets
|
||||
from oauth2client.contrib.appengine import StorageByKeyName
|
||||
from oauth2client.client import _CLOUDSDK_CONFIG_ENV_VAR
|
||||
from oauth2client.client import AccessTokenRefreshError
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.client import flow_from_clientsecrets
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from webtest import TestApp
|
||||
|
||||
from ..http_mock import CacheMock
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
|
||||
@@ -19,17 +19,17 @@ import json
|
||||
import os
|
||||
import socket
|
||||
import threading
|
||||
import unittest2
|
||||
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client.contrib import devshell
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from oauth2client.contrib import devshell
|
||||
from oauth2client.contrib.devshell import _SendRecv
|
||||
from oauth2client.contrib.devshell import CREDENTIAL_INFO_REQUEST_JSON
|
||||
from oauth2client.contrib.devshell import CommunicationError
|
||||
from oauth2client.contrib.devshell import CREDENTIAL_INFO_REQUEST_JSON
|
||||
from oauth2client.contrib.devshell import CredentialInfoResponse
|
||||
from oauth2client.contrib.devshell import DEVSHELL_ENV
|
||||
from oauth2client.contrib.devshell import DevshellCredentials
|
||||
|
||||
@@ -21,7 +21,6 @@ import base64
|
||||
import datetime
|
||||
import os
|
||||
import pickle
|
||||
import unittest2
|
||||
|
||||
# Mock a Django environment
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.contrib.test_django_settings'
|
||||
@@ -35,8 +34,6 @@ import django
|
||||
django.setup()
|
||||
from django.apps import AppConfig
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class DjangoOrmTestApp(AppConfig):
|
||||
"""App Config for Django Helper."""
|
||||
@@ -45,6 +42,10 @@ class DjangoOrmTestApp(AppConfig):
|
||||
|
||||
|
||||
from django.db import models
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import Flow
|
||||
@@ -52,7 +53,6 @@ from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.contrib.django_orm import CredentialsField
|
||||
from oauth2client.contrib.django_orm import FlowField
|
||||
from oauth2client.contrib.django_orm import Storage
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
|
||||
__author__ = 'conleyo@google.com (Conley Owens)'
|
||||
|
||||
|
||||
@@ -13,22 +13,23 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
import unittest2
|
||||
|
||||
from django.conf.urls import include, url
|
||||
from django.core import exceptions
|
||||
from django import http
|
||||
from django import test
|
||||
import mock
|
||||
from oauth2client.client import FlowExchangeError, OAuth2WebServerFlow
|
||||
import django.conf
|
||||
from django.conf.urls import include, url
|
||||
from django.core import exceptions
|
||||
import mock
|
||||
from six.moves import http_client
|
||||
from six.moves.urllib import parse
|
||||
import unittest2
|
||||
|
||||
from oauth2client.client import FlowExchangeError, OAuth2WebServerFlow
|
||||
from oauth2client.contrib import django_util
|
||||
from oauth2client.contrib.django_util import decorators
|
||||
from oauth2client.contrib.django_util import site
|
||||
from oauth2client.contrib.django_util import storage
|
||||
from oauth2client.contrib.django_util import views
|
||||
from six.moves import http_client
|
||||
from six.moves.urllib import parse
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^oauth2/', include(site.urls))
|
||||
|
||||
@@ -15,21 +15,21 @@
|
||||
"""Unit tests for the Flask utilities"""
|
||||
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
import unittest2
|
||||
|
||||
import flask
|
||||
import six.moves.http_client as httplib
|
||||
import httplib2
|
||||
import mock
|
||||
import six.moves.http_client as httplib
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import unittest2
|
||||
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import GOOGLE_AUTH_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.contrib.flask_util import _get_flow_for_token
|
||||
from oauth2client.contrib.flask_util import UserOAuth2 as FlaskOAuth2
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
|
||||
|
||||
__author__ = 'jonwayne@google.com (Jon Wayne Parrott)'
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
"""Unit tests for oauth2client.contrib.gce."""
|
||||
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
|
||||
import httplib2
|
||||
import mock
|
||||
from six.moves import http_client
|
||||
from tests.contrib.test_metadata import request_mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from oauth2client.client import HttpAccessTokenRefreshError
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from oauth2client.contrib.gce import _SCOPES_WARNING
|
||||
from oauth2client.contrib.gce import AppAssertionCredentials
|
||||
from tests.contrib.test_metadata import request_mock
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
"""Tests for oauth2client.contrib.keyring_storage."""
|
||||
|
||||
import datetime
|
||||
import keyring
|
||||
import threading
|
||||
import unittest2
|
||||
|
||||
import keyring
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
# limitations under the License.
|
||||
|
||||
import datetime
|
||||
import httplib2
|
||||
import json
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
import httplib2
|
||||
import mock
|
||||
from six.moves import http_client
|
||||
import unittest2
|
||||
|
||||
from oauth2client.contrib import _metadata
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ import errno
|
||||
import os
|
||||
import stat
|
||||
import tempfile
|
||||
import unittest2
|
||||
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client import util
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
|
||||
@@ -14,14 +14,15 @@
|
||||
|
||||
import datetime
|
||||
|
||||
import oauth2client
|
||||
import oauth2client.client
|
||||
import oauth2client.contrib.sqlalchemy
|
||||
import sqlalchemy
|
||||
import sqlalchemy.ext.declarative
|
||||
import sqlalchemy.orm
|
||||
import unittest2
|
||||
|
||||
import oauth2client
|
||||
import oauth2client.client
|
||||
import oauth2client.contrib.sqlalchemy
|
||||
|
||||
Base = sqlalchemy.ext.declarative.declarative_base()
|
||||
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
"""Tests for oauth2client.contrib.xsrfutil."""
|
||||
|
||||
import base64
|
||||
import unittest2
|
||||
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client.contrib import xsrfutil
|
||||
|
||||
@@ -22,8 +22,8 @@ import rsa
|
||||
import six
|
||||
import unittest2
|
||||
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client import _pure_python_crypt
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client.crypt import RsaSigner
|
||||
from oauth2client.crypt import RsaVerifier
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"""Unit tests for oauth2client._pycrypto_crypt."""
|
||||
|
||||
import os
|
||||
|
||||
import unittest2
|
||||
|
||||
from oauth2client.crypt import PyCryptoSigner
|
||||
|
||||
@@ -34,38 +34,12 @@ from six.moves import http_client
|
||||
from six.moves import urllib
|
||||
import unittest2
|
||||
|
||||
from .http_mock import CacheMock
|
||||
from .http_mock import HttpMock
|
||||
from .http_mock import HttpMockSequence
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import GOOGLE_TOKEN_INFO_URI
|
||||
from oauth2client import client
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_INFO_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import util as oauth2client_util
|
||||
from oauth2client.client import AccessTokenCredentials
|
||||
from oauth2client.client import AccessTokenCredentialsError
|
||||
from oauth2client.client import HttpAccessTokenRefreshError
|
||||
from oauth2client.client import ADC_HELP_MSG
|
||||
from oauth2client.client import AssertionCredentials
|
||||
from oauth2client.client import AUTHORIZED_USER
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import DEFAULT_ENV_NAME
|
||||
from oauth2client.client import DeviceFlowInfo
|
||||
from oauth2client.client import Error
|
||||
from oauth2client.client import ApplicationDefaultCredentialsError
|
||||
from oauth2client.client import FlowExchangeError
|
||||
from oauth2client.client import GoogleCredentials
|
||||
from oauth2client.client import GOOGLE_APPLICATION_CREDENTIALS
|
||||
from oauth2client.client import MemoryCache
|
||||
from oauth2client.client import NonAsciiHeaderError
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.client import OOB_CALLBACK_URN
|
||||
from oauth2client.client import REFRESH_STATUS_CODES
|
||||
from oauth2client.client import SERVICE_ACCOUNT
|
||||
from oauth2client.client import Storage
|
||||
from oauth2client.client import TokenRevokeError
|
||||
from oauth2client.client import VerifyJwtTokenError
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from oauth2client.client import _extract_id_token
|
||||
from oauth2client.client import _get_application_default_credential_from_file
|
||||
from oauth2client.client import _get_environment_variable_file
|
||||
@@ -76,15 +50,41 @@ from oauth2client.client import _raise_exception_for_missing_fields
|
||||
from oauth2client.client import _raise_exception_for_reading_json
|
||||
from oauth2client.client import _update_query_params
|
||||
from oauth2client.client import _WELL_KNOWN_CREDENTIALS_FILE
|
||||
from oauth2client.client import AccessTokenCredentials
|
||||
from oauth2client.client import AccessTokenCredentialsError
|
||||
from oauth2client.client import ADC_HELP_MSG
|
||||
from oauth2client.client import ApplicationDefaultCredentialsError
|
||||
from oauth2client.client import AssertionCredentials
|
||||
from oauth2client.client import AUTHORIZED_USER
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import credentials_from_clientsecrets_and_code
|
||||
from oauth2client.client import credentials_from_code
|
||||
from oauth2client.client import DEFAULT_ENV_NAME
|
||||
from oauth2client.client import DeviceFlowInfo
|
||||
from oauth2client.client import Error
|
||||
from oauth2client.client import flow_from_clientsecrets
|
||||
from oauth2client.client import FlowExchangeError
|
||||
from oauth2client.client import GOOGLE_APPLICATION_CREDENTIALS
|
||||
from oauth2client.client import GoogleCredentials
|
||||
from oauth2client.client import HttpAccessTokenRefreshError
|
||||
from oauth2client.client import MemoryCache
|
||||
from oauth2client.client import NonAsciiHeaderError
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from oauth2client.client import OAuth2WebServerFlow
|
||||
from oauth2client.client import OOB_CALLBACK_URN
|
||||
from oauth2client.client import REFRESH_STATUS_CODES
|
||||
from oauth2client.client import save_to_well_known_file
|
||||
from oauth2client.client import SERVICE_ACCOUNT
|
||||
from oauth2client.client import Storage
|
||||
from oauth2client.client import TokenRevokeError
|
||||
from oauth2client.client import VerifyJwtTokenError
|
||||
from oauth2client.clientsecrets import _loadfile
|
||||
from oauth2client.clientsecrets import InvalidClientSecretsError
|
||||
from oauth2client.clientsecrets import TYPE_WEB
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
from oauth2client._helpers import _to_bytes
|
||||
from .http_mock import CacheMock
|
||||
from .http_mock import HttpMock
|
||||
from .http_mock import HttpMockSequence
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
|
||||
@@ -18,13 +18,14 @@ import errno
|
||||
from io import StringIO
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import unittest2
|
||||
|
||||
from oauth2client._helpers import _from_bytes
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client import GOOGLE_AUTH_URI
|
||||
from oauth2client import GOOGLE_REVOKE_URI
|
||||
from oauth2client import GOOGLE_TOKEN_URI
|
||||
from oauth2client import clientsecrets
|
||||
from oauth2client._helpers import _from_bytes
|
||||
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
|
||||
import base64
|
||||
import os
|
||||
import unittest2
|
||||
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from oauth2client import _helpers
|
||||
from oauth2client.client import HAS_OPENSSL
|
||||
from oauth2client import crypt
|
||||
from oauth2client.client import HAS_OPENSSL
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
|
||||
|
||||
|
||||
@@ -24,15 +24,16 @@ import os
|
||||
import pickle
|
||||
import stat
|
||||
import tempfile
|
||||
import unittest2
|
||||
|
||||
from .http_mock import HttpMockSequence
|
||||
import six
|
||||
from six.moves import http_client
|
||||
import unittest2
|
||||
|
||||
from oauth2client import file
|
||||
from oauth2client.client import AccessTokenCredentials
|
||||
from oauth2client.client import OAuth2Credentials
|
||||
from six.moves import http_client
|
||||
from .http_mock import HttpMockSequence
|
||||
|
||||
try:
|
||||
# Python2
|
||||
from future_builtins import oct
|
||||
|
||||
@@ -21,16 +21,16 @@ import time
|
||||
import mock
|
||||
import unittest2
|
||||
|
||||
from .http_mock import HttpMockSequence
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import VerifyJwtTokenError
|
||||
from oauth2client.client import verify_id_token
|
||||
from oauth2client.client import HAS_OPENSSL
|
||||
from oauth2client.client import HAS_CRYPTO
|
||||
from oauth2client import crypt
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import HAS_CRYPTO
|
||||
from oauth2client.client import HAS_OPENSSL
|
||||
from oauth2client.client import verify_id_token
|
||||
from oauth2client.client import VerifyJwtTokenError
|
||||
from oauth2client.file import Storage
|
||||
from oauth2client.service_account import _PASSWORD_DEFAULT
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
from .http_mock import HttpMockSequence
|
||||
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
@@ -20,20 +20,19 @@ Unit tests for service account credentials implemented using RSA.
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import rsa
|
||||
import tempfile
|
||||
|
||||
import httplib2
|
||||
import mock
|
||||
import rsa
|
||||
from six import BytesIO
|
||||
import unittest2
|
||||
|
||||
from .http_mock import HttpMockSequence
|
||||
from oauth2client import crypt
|
||||
from oauth2client.service_account import _JWTAccessCredentials
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
from oauth2client.service_account import SERVICE_ACCOUNT
|
||||
|
||||
from six import BytesIO
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
from .http_mock import HttpMockSequence
|
||||
|
||||
|
||||
def data_filename(filename):
|
||||
|
||||
@@ -20,9 +20,9 @@ import mock
|
||||
from six.moves.urllib import request
|
||||
import unittest2
|
||||
|
||||
from oauth2client import tools
|
||||
from oauth2client.client import FlowExchangeError
|
||||
from oauth2client.client import OOB_CALLBACK_URN
|
||||
from oauth2client import tools
|
||||
|
||||
try:
|
||||
import argparse
|
||||
|
||||
10
tox.ini
10
tox.ini
@@ -156,17 +156,21 @@ deps =
|
||||
passenv = {[testenv:system-tests]passenv}
|
||||
|
||||
[testenv:flake8]
|
||||
commands = flake8 {posargs}
|
||||
deps = flake8-putty
|
||||
commands = flake8 --import-order-style google {posargs}
|
||||
deps =
|
||||
flake8-putty
|
||||
flake8-import-order
|
||||
|
||||
[flake8]
|
||||
exclude = .tox,.git,./*.egg,build,
|
||||
application-import-names = oauth2client
|
||||
putty-ignore =
|
||||
# E402 module level import not at top of file
|
||||
# These files have needed configurations defined before import
|
||||
docs/conf.py : E402
|
||||
tests/contrib/test_appengine.py : E402
|
||||
tests/contrib/test_django_orm.py : E402
|
||||
# Additionally, ignore E100 (imports in wrong order) for Django configuration
|
||||
tests/contrib/test_django_orm.py : E402,I100
|
||||
# E501 line too long
|
||||
# Ignore lines over 80 chars that include "http:" or "https:"
|
||||
/http:/ : E501
|
||||
|
||||
Reference in New Issue
Block a user