From c2354eff9fed8c3a6e4fb16ed6579a74c5a4ba6c Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Fri, 28 Oct 2011 12:04:18 +0200 Subject: [PATCH] pep8 now likes wsme --- wsme/api.py | 3 --- wsme/protocols/rest.py | 1 - wsme/protocols/restxml.py | 3 ++- wsme/tests/test_api.py | 3 ++- wsme/tests/test_exc.py | 1 - wsme/tests/test_protocols.py | 4 ++-- wsme/tests/test_restjson.py | 1 - wsme/tests/test_types.py | 1 - wsme/utils.py | 1 - 9 files changed, 6 insertions(+), 12 deletions(-) diff --git a/wsme/api.py b/wsme/api.py index 44553d0..599bd48 100644 --- a/wsme/api.py +++ b/wsme/api.py @@ -197,6 +197,3 @@ class validate(object): fd.arguments.append(FunctionArgument(argname, datatype, mandatory, default)) return func - - - diff --git a/wsme/protocols/rest.py b/wsme/protocols/rest.py index 0cca229..d70f940 100644 --- a/wsme/protocols/rest.py +++ b/wsme/protocols/rest.py @@ -65,4 +65,3 @@ class RestProtocol(object): if parsed_args: raise UnknownArgument(parsed_args.keys()[0]) return kw - diff --git a/wsme/protocols/restxml.py b/wsme/protocols/restxml.py index 97af455..8c39a37 100644 --- a/wsme/protocols/restxml.py +++ b/wsme/protocols/restxml.py @@ -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') diff --git a/wsme/tests/test_api.py b/wsme/tests/test_api.py index 2e09aa7..9d5978d 100644 --- a/wsme/tests/test_api.py +++ b/wsme/tests/test_api.py @@ -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) diff --git a/wsme/tests/test_exc.py b/wsme/tests/test_exc.py index 42676f9..44b710f 100644 --- a/wsme/tests/test_exc.py +++ b/wsme/tests/test_exc.py @@ -29,4 +29,3 @@ def test_unknownargument(): assert e.faultstring == \ u'Unknown argument: "argname": error message', e.faultstring - diff --git a/wsme/tests/test_protocols.py b/wsme/tests/test_protocols.py index dadd8ee..ae6e906 100644 --- a/wsme/tests/test_protocols.py +++ b/wsme/tests/test_protocols.py @@ -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 - - diff --git a/wsme/tests/test_restjson.py b/wsme/tests/test_restjson.py index beba674..1f97b6f 100644 --- a/wsme/tests/test_restjson.py +++ b/wsme/tests/test_restjson.py @@ -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} - diff --git a/wsme/tests/test_types.py b/wsme/tests/test_types.py index baadfd6..335a375 100644 --- a/wsme/tests/test_types.py +++ b/wsme/tests/test_types.py @@ -119,7 +119,6 @@ class TestTypes(unittest.TestCase): class SelfRefType(object): pass - SelfRefType.parent = SelfRefType types.register_type(SelfRefType) diff --git a/wsme/utils.py b/wsme/utils.py index b2290e3..3160c81 100644 --- a/wsme/utils.py +++ b/wsme/utils.py @@ -72,4 +72,3 @@ def parse_isodatetime(value): except ValueError, e: raise validators.Invalid("%s is a out-of-range datetime" % (value), value, None) -