(self, *path_args)
| 574 | |
| 575 | class EchoHandler(RequestHandler): |
| 576 | def get(self, *path_args): |
| 577 | # Type checks: web.py interfaces convert argument values to |
| 578 | # unicode strings (by default, but see also decode_argument). |
| 579 | # In httpserver.py (i.e. self.request.arguments), they're left |
| 580 | # as bytes. Keys are always native strings. |
| 581 | for key in self.request.arguments: |
| 582 | if type(key) is not str: |
| 583 | raise Exception("incorrect type for key: %r" % type(key)) |
| 584 | for bvalue in self.request.arguments[key]: |
| 585 | if type(bvalue) is not bytes: |
| 586 | raise Exception("incorrect type for value: %r" % type(bvalue)) |
| 587 | for svalue in self.get_arguments(key): |
| 588 | if type(svalue) is not unicode_type: |
| 589 | raise Exception("incorrect type for value: %r" % type(svalue)) |
| 590 | for arg in path_args: |
| 591 | if type(arg) is not unicode_type: |
| 592 | raise Exception("incorrect type for path arg: %r" % type(arg)) |
| 593 | self.write( |
| 594 | dict( |
| 595 | path=self.request.path, |
| 596 | path_args=path_args, |
| 597 | args=recursive_unicode(self.request.arguments), |
| 598 | ) |
| 599 | ) |
| 600 | |
| 601 | |
| 602 | class RequestEncodingTest(WebTestCase): |
no test coverage detected