MCPcopy Create free account
hub / github.com/EasyIME/PIME / get

Method get

python/python3/tornado/test/web_test.py:496–519  ·  view source on GitHub ↗
(self, *path_args)

Source from the content-addressed store, hash-verified

494
495class EchoHandler(RequestHandler):
496 def get(self, *path_args):
497 # Type checks: web.py interfaces convert argument values to
498 # unicode strings (by default, but see also decode_argument).
499 # In httpserver.py (i.e. self.request.arguments), they're left
500 # as bytes. Keys are always native strings.
501 for key in self.request.arguments:
502 if type(key) != str:
503 raise Exception("incorrect type for key: %r" % type(key))
504 for bvalue in self.request.arguments[key]:
505 if type(bvalue) != bytes:
506 raise Exception("incorrect type for value: %r" % type(bvalue))
507 for svalue in self.get_arguments(key):
508 if type(svalue) != unicode_type:
509 raise Exception("incorrect type for value: %r" % type(svalue))
510 for arg in path_args:
511 if type(arg) != unicode_type:
512 raise Exception("incorrect type for path arg: %r" % type(arg))
513 self.write(
514 dict(
515 path=self.request.path,
516 path_args=path_args,
517 args=recursive_unicode(self.request.arguments),
518 )
519 )
520
521
522class RequestEncodingTest(WebTestCase):

Callers 15

do_test_connectMethod · 0.45
set_environFunction · 0.45
get_and_discardMethod · 0.45
workerMethod · 0.45
test_task_done_delayMethod · 0.45
test_orderMethod · 0.45
test_orderMethod · 0.45
consumerMethod · 0.45
test_csvMethod · 0.45
test_csv_bomMethod · 0.45
test_gettextMethod · 0.45
test_format_dateMethod · 0.45

Calls 4

recursive_unicodeFunction · 0.90
get_argumentsMethod · 0.80
typeEnum · 0.50
writeMethod · 0.45

Tested by

no test coverage detected