Fix broken wsme-stable job and pep8 failures.
Change-Id: I4ff0a7a7926f7a645fa8d59242be9d31bd683106
This commit is contained in:
committed by
Ryan Petrello
parent
ff88de0f8c
commit
f4d923dca6
@@ -11,10 +11,6 @@ import operator
|
|||||||
import types
|
import types
|
||||||
|
|
||||||
import six
|
import six
|
||||||
if six.PY3:
|
|
||||||
from .compat import is_bound_method as ismethod
|
|
||||||
else:
|
|
||||||
from inspect import ismethod
|
|
||||||
|
|
||||||
from webob import (Request as WebObRequest, Response as WebObResponse, exc,
|
from webob import (Request as WebObRequest, Response as WebObResponse, exc,
|
||||||
acceptparse)
|
acceptparse)
|
||||||
@@ -27,6 +23,10 @@ from .routing import lookup_controller, NonCanonicalPath
|
|||||||
from .util import _cfg, encode_if_needed, getargspec
|
from .util import _cfg, encode_if_needed, getargspec
|
||||||
from .middleware.recursive import ForwardRequestException
|
from .middleware.recursive import ForwardRequestException
|
||||||
|
|
||||||
|
if six.PY3:
|
||||||
|
from .compat import is_bound_method as ismethod
|
||||||
|
else:
|
||||||
|
from inspect import ismethod
|
||||||
|
|
||||||
# make sure that json is defined in mimetypes
|
# make sure that json is defined in mimetypes
|
||||||
add_type('application/json', '.json', True)
|
add_type('application/json', '.json', True)
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ def lookup_controller(obj, remainder, request=None):
|
|||||||
# If no arguments are passed to the _lookup, yet the
|
# If no arguments are passed to the _lookup, yet the
|
||||||
# argspec requires at least one, raise a 404
|
# argspec requires at least one, raise a 404
|
||||||
if (
|
if (
|
||||||
remainder == ['']
|
remainder == [''] and
|
||||||
and len(obj._pecan['argspec'].args) > 1
|
len(obj._pecan['argspec'].args) > 1
|
||||||
):
|
):
|
||||||
raise exc.HTTPNotFound
|
raise exc.HTTPNotFound
|
||||||
obj_, remainder_ = result
|
obj_, remainder_ = result
|
||||||
|
|||||||
@@ -4,16 +4,16 @@ from webob import exc
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
if six.PY3:
|
|
||||||
from .compat import is_bound_method as ismethod
|
|
||||||
else:
|
|
||||||
from inspect import ismethod
|
|
||||||
|
|
||||||
from .decorators import expose
|
from .decorators import expose
|
||||||
from .util import _cfg, iscontroller
|
from .util import _cfg, iscontroller
|
||||||
|
|
||||||
__all__ = ['unlocked', 'secure', 'SecureController']
|
__all__ = ['unlocked', 'secure', 'SecureController']
|
||||||
|
|
||||||
|
if six.PY3:
|
||||||
|
from .compat import is_bound_method as ismethod
|
||||||
|
else:
|
||||||
|
from inspect import ismethod
|
||||||
|
|
||||||
|
|
||||||
class _SecureState(object):
|
class _SecureState(object):
|
||||||
def __init__(self, desc, boolean_value):
|
def __init__(self, desc, boolean_value):
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from six import b as b_
|
||||||
|
|
||||||
|
from pecan.compat import urlopen, URLError
|
||||||
|
from pecan.tests import PecanTestCase
|
||||||
|
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
import unittest2 as unittest
|
import unittest2 as unittest
|
||||||
else:
|
else:
|
||||||
import unittest # noqa
|
import unittest # noqa
|
||||||
|
|
||||||
from six import b as b_
|
|
||||||
|
|
||||||
from pecan.compat import urlopen, URLError
|
|
||||||
from pecan.tests import PecanTestCase
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,6 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import warnings
|
import warnings
|
||||||
if sys.version_info < (2, 7):
|
|
||||||
import unittest2 as unittest # pragma: nocover
|
|
||||||
else:
|
|
||||||
import unittest # pragma: nocover
|
|
||||||
|
|
||||||
import webob
|
import webob
|
||||||
from webob.exc import HTTPNotFound
|
from webob.exc import HTTPNotFound
|
||||||
@@ -25,6 +21,11 @@ from pecan.templating import (
|
|||||||
from pecan.decorators import accept_noncanonical
|
from pecan.decorators import accept_noncanonical
|
||||||
from pecan.tests import PecanTestCase
|
from pecan.tests import PecanTestCase
|
||||||
|
|
||||||
|
if sys.version_info < (2, 7):
|
||||||
|
import unittest2 as unittest # pragma: nocover
|
||||||
|
else:
|
||||||
|
import unittest # pragma: nocover
|
||||||
|
|
||||||
|
|
||||||
class SampleRootController(object):
|
class SampleRootController(object):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info < (2, 7):
|
|
||||||
import unittest2 as unittest
|
|
||||||
else:
|
|
||||||
import unittest # noqa
|
|
||||||
|
|
||||||
from six import b as b_
|
from six import b as b_
|
||||||
from webtest import TestApp
|
from webtest import TestApp
|
||||||
|
|
||||||
@@ -12,6 +7,11 @@ from pecan import expose, make_app
|
|||||||
from pecan.secure import secure, unlocked, SecureController
|
from pecan.secure import secure, unlocked, SecureController
|
||||||
from pecan.tests import PecanTestCase
|
from pecan.tests import PecanTestCase
|
||||||
|
|
||||||
|
if sys.version_info < (2, 7):
|
||||||
|
import unittest2 as unittest
|
||||||
|
else:
|
||||||
|
import unittest # noqa
|
||||||
|
|
||||||
try:
|
try:
|
||||||
set()
|
set()
|
||||||
except:
|
except:
|
||||||
|
|||||||
5
tox.ini
5
tox.ini
@@ -114,10 +114,7 @@ commands=pecan create testing123 rest-api
|
|||||||
[testenv:wsme-stable]
|
[testenv:wsme-stable]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
deps = nose
|
deps = nose
|
||||||
wsme
|
commands = pip install --build {envdir}/build --pre --no-clean --no-use-wheel wsme
|
||||||
# Manually download the source from PyPI with the --download flag.
|
|
||||||
# This gives us the ability to run the wsmeext (pecan) tests.
|
|
||||||
commands = pip install --download {envdir} --no-deps --no-clean --no-use-wheel wsme
|
|
||||||
nosetests -v {envdir}/build/wsme/tests/pecantest
|
nosetests -v {envdir}/build/wsme/tests/pecantest
|
||||||
|
|
||||||
[testenv:wsme-tip]
|
[testenv:wsme-tip]
|
||||||
|
|||||||
Reference in New Issue
Block a user