MCPcopy Create free account
hub / github.com/Pylons/webtest / __call__

Method __call__

tests/test_forms.py:824–845  ·  view source on GitHub ↗
(self, environ, start_response)

Source from the content-addressed store, hash-verified

822"""
823
824 def __call__(self, environ, start_response):
825 req = Request(environ)
826 status = b"200 OK"
827 if req.method == "GET":
828 body = self.body
829 else:
830 body = b"""
831<html>
832 <head><title>display page</title></head>
833 <body>
834 """ + self.get_files_page(req) + b"""
835 </body>
836</html>
837"""
838 headers = [
839 ('Content-Type', 'text/html; charset=utf-8'),
840 ('Content-Length', str(len(body)))]
841 # PEP 3333 requires native strings:
842 headers = [(str(k), str(v)) for k, v in headers]
843 start_response(status, headers)
844 assert(isinstance(body, bytes))
845 return [body]
846
847 def get_files_page(self, req):
848 file_parts = []

Callers

nothing calls this directly

Calls 1

get_files_pageMethod · 0.95

Tested by

no test coverage detected