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 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,
|
||||
acceptparse)
|
||||
@@ -27,6 +23,10 @@ from .routing import lookup_controller, NonCanonicalPath
|
||||
from .util import _cfg, encode_if_needed, getargspec
|
||||
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
|
||||
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
|
||||
# argspec requires at least one, raise a 404
|
||||
if (
|
||||
remainder == ['']
|
||||
and len(obj._pecan['argspec'].args) > 1
|
||||
remainder == [''] and
|
||||
len(obj._pecan['argspec'].args) > 1
|
||||
):
|
||||
raise exc.HTTPNotFound
|
||||
obj_, remainder_ = result
|
||||
|
||||
@@ -4,16 +4,16 @@ from webob import exc
|
||||
|
||||
import six
|
||||
|
||||
if six.PY3:
|
||||
from .compat import is_bound_method as ismethod
|
||||
else:
|
||||
from inspect import ismethod
|
||||
|
||||
from .decorators import expose
|
||||
from .util import _cfg, iscontroller
|
||||
|
||||
__all__ = ['unlocked', 'secure', 'SecureController']
|
||||
|
||||
if six.PY3:
|
||||
from .compat import is_bound_method as ismethod
|
||||
else:
|
||||
from inspect import ismethod
|
||||
|
||||
|
||||
class _SecureState(object):
|
||||
def __init__(self, desc, boolean_value):
|
||||
|
||||
@@ -3,17 +3,16 @@ import sys
|
||||
import subprocess
|
||||
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):
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest # noqa
|
||||
|
||||
from six import b as b_
|
||||
|
||||
from pecan.compat import urlopen, URLError
|
||||
from pecan.tests import PecanTestCase
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@ import sys
|
||||
import os
|
||||
import json
|
||||
import warnings
|
||||
if sys.version_info < (2, 7):
|
||||
import unittest2 as unittest # pragma: nocover
|
||||
else:
|
||||
import unittest # pragma: nocover
|
||||
|
||||
import webob
|
||||
from webob.exc import HTTPNotFound
|
||||
@@ -25,6 +21,11 @@ from pecan.templating import (
|
||||
from pecan.decorators import accept_noncanonical
|
||||
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):
|
||||
pass
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest # noqa
|
||||
|
||||
from six import b as b_
|
||||
from webtest import TestApp
|
||||
|
||||
@@ -12,6 +7,11 @@ from pecan import expose, make_app
|
||||
from pecan.secure import secure, unlocked, SecureController
|
||||
from pecan.tests import PecanTestCase
|
||||
|
||||
if sys.version_info < (2, 7):
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest # noqa
|
||||
|
||||
try:
|
||||
set()
|
||||
except:
|
||||
|
||||
5
tox.ini
5
tox.ini
@@ -114,10 +114,7 @@ commands=pecan create testing123 rest-api
|
||||
[testenv:wsme-stable]
|
||||
basepython = python2.7
|
||||
deps = nose
|
||||
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
|
||||
commands = pip install --build {envdir}/build --pre --no-clean --no-use-wheel wsme
|
||||
nosetests -v {envdir}/build/wsme/tests/pecantest
|
||||
|
||||
[testenv:wsme-tip]
|
||||
|
||||
Reference in New Issue
Block a user