Fix pep8 errors
The recent pep8 upgrade is triggering new errors. Change-Id: I73b1de3afed0a6979e0542e4c90cdb0bdb8b1122
This commit is contained in:
parent
8265906fb8
commit
8e6077e270
@ -262,8 +262,6 @@ def encode_sample_params(params, format=False):
|
||||
|
||||
def encode_sample_result(datatype, value, format=False):
|
||||
r = tojson(datatype, value)
|
||||
#if self.nest_result:
|
||||
#r = {'result': r}
|
||||
content = json.dumps(r, ensure_ascii=False, indent=4 if format else 0,
|
||||
sort_keys=format)
|
||||
return ('javascript', content)
|
||||
|
@ -330,14 +330,6 @@ class TestRestJson(wsme.tests.protocol.RestOnlyProtocolTestCase):
|
||||
)
|
||||
assert r[0] == 'javascript', r[0]
|
||||
assert r[1] == '''2'''
|
||||
#self.root.protocols[0].nest_result = True
|
||||
#r = wsme.rest.json.encode_sample_result(
|
||||
#int, 2, True
|
||||
#)
|
||||
#assert r[0] == 'javascript', r[0]
|
||||
#assert r[1] == '''{
|
||||
#"result": 2
|
||||
#}'''
|
||||
|
||||
def test_PUT(self):
|
||||
data = {"id": 1, "name": u("test")}
|
||||
|
@ -56,7 +56,6 @@ type_registry = {
|
||||
int: 'xs:int',
|
||||
float: "xs:float",
|
||||
bool: "xs:boolean",
|
||||
#unsigned: "xs:unsignedInt",
|
||||
datetime.datetime: "xs:dateTime",
|
||||
datetime.date: "xs:date",
|
||||
datetime.time: "xs:time",
|
||||
|
@ -125,9 +125,9 @@ class Base(six.with_metaclass(BaseMeta, wsme.types.Base)):
|
||||
for attr in self._wsme_attributes:
|
||||
if not isinstance(attr, wsattr):
|
||||
continue
|
||||
if attrs and not attr.isrelation and not attr.name in attrs:
|
||||
if attrs and not attr.isrelation and attr.name not in attrs:
|
||||
continue
|
||||
if attr.isrelation and not attr.name in eagerload:
|
||||
if attr.isrelation and attr.name not in eagerload:
|
||||
continue
|
||||
value = getattr(instance, attr.saname)
|
||||
if attr.isrelation:
|
||||
|
@ -258,7 +258,7 @@ def fromsuds(dt, value):
|
||||
return [fromsuds(dt[0], item) for item in value.item]
|
||||
if wsme.types.isarray(dt):
|
||||
return [fromsuds(dt.item_type, item) for item in value.item]
|
||||
if wsme.types.isusertype(dt) and not dt in fromsuds_types:
|
||||
if wsme.types.isusertype(dt) and dt not in fromsuds_types:
|
||||
dt = dt.basetype
|
||||
if dt in fromsuds_types:
|
||||
print(dt, value)
|
||||
@ -390,12 +390,7 @@ class TestSOAP(wsme.tests.protocol.ProtocolTestCase):
|
||||
return self._sudsclient
|
||||
|
||||
def test_wsdl(self):
|
||||
#assert res.body.find('NestedOuter_Array') != -1
|
||||
#assert 'returntypesGettext' in res.body
|
||||
#assert 'returntypesGettextResponse' in res.body
|
||||
#
|
||||
c = self.sudsclient
|
||||
print(c)
|
||||
assert c.wsdl.tns[1] == tns, c.wsdl.tns
|
||||
|
||||
sd = c.sd[0]
|
||||
|
Loading…
Reference in New Issue
Block a user