pep8 now likes wsme
This commit is contained in:
@@ -197,6 +197,3 @@ class validate(object):
|
||||
fd.arguments.append(FunctionArgument(argname, datatype,
|
||||
mandatory, default))
|
||||
return func
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,4 +65,3 @@ class RestProtocol(object):
|
||||
if parsed_args:
|
||||
raise UnknownArgument(parsed_args.keys()[0])
|
||||
return kw
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ class RestXmlProtocol(RestProtocol):
|
||||
return dict((sub.tag, sub) for sub in et.fromstring(body))
|
||||
|
||||
def encode_result(self, context, result):
|
||||
return et.tostring(toxml(context.funcdef.return_type, 'result', result))
|
||||
return et.tostring(
|
||||
toxml(context.funcdef.return_type, 'result', result))
|
||||
|
||||
def encode_error(self, context, errordetail):
|
||||
el = et.Element('error')
|
||||
|
||||
@@ -13,6 +13,7 @@ import wsme.wsgi
|
||||
|
||||
from wsme.tests.test_protocols import DummyProtocol
|
||||
|
||||
|
||||
def test_pexpose():
|
||||
class Proto(DummyProtocol):
|
||||
def extract_path(self, context):
|
||||
@@ -160,7 +161,7 @@ class TestController(unittest.TestCase):
|
||||
|
||||
p = NoPathProto()
|
||||
r = MyRoot(protocols=[p])
|
||||
|
||||
|
||||
app = webtest.TestApp(wsme.wsgi.adapt(r))
|
||||
|
||||
res = app.get('/', expect_errors=True)
|
||||
|
||||
@@ -29,4 +29,3 @@ def test_unknownargument():
|
||||
|
||||
assert e.faultstring == \
|
||||
u'Unknown argument: "argname": error message', e.faultstring
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from wsme import WSRoot
|
||||
from wsme.protocols import getprotocol, CallContext
|
||||
import wsme.protocols
|
||||
|
||||
|
||||
class DummyProtocol(object):
|
||||
name = 'dummy'
|
||||
content_types = ['', None]
|
||||
@@ -41,6 +42,7 @@ def test_getprotocol():
|
||||
except ValueError, e:
|
||||
pass
|
||||
|
||||
|
||||
class TestProtocols(unittest.TestCase):
|
||||
def test_register_protocol(self):
|
||||
wsme.protocols.register_protocol(DummyProtocol)
|
||||
@@ -56,5 +58,3 @@ class TestProtocols(unittest.TestCase):
|
||||
r = WSRoot(['dummy'])
|
||||
assert len(r.protocols) == 1
|
||||
assert r.protocols[0].__class__ == DummyProtocol
|
||||
|
||||
|
||||
|
||||
@@ -95,4 +95,3 @@ class TestRestJson(wsme.tests.protocol.ProtocolTestCase):
|
||||
def test_keyargs(self):
|
||||
r = self.app.get('/argtypes/setint.json?value=2')
|
||||
assert json.loads(r.body) == {'result': 2}
|
||||
|
||||
|
||||
@@ -119,7 +119,6 @@ class TestTypes(unittest.TestCase):
|
||||
class SelfRefType(object):
|
||||
pass
|
||||
|
||||
|
||||
SelfRefType.parent = SelfRefType
|
||||
|
||||
types.register_type(SelfRefType)
|
||||
|
||||
@@ -72,4 +72,3 @@ def parse_isodatetime(value):
|
||||
except ValueError, e:
|
||||
raise validators.Invalid("%s is a out-of-range datetime" % (value),
|
||||
value, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user