示例#1
0
 def _extract_raw_data_request(request):
     if request.method == 'GET':
         return u(request.query_string)
     elif request.method == 'POST':
         if request.data:
             return u(request.data)
         elif request.form.to_dict():
             return u(list(request.form.to_dict().keys())[0])
     return u('')
 def test_types(self):
     assert type(u('')) == String
     assert type('') == String
     assert not type('') == Object
     assert not type([]) == Object
     assert type([]) == Array
     assert type('') == Any
     assert Any.kind('') == String
     assert Any.decode('str') == String
     assert Any.kind({}) == Object
     assert Any.kind(None) == Nil
 def _call(self, req):
     return json.loads(u(self.app.post(self.service_url, data=req).data).decode('utf-8'))