Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def callFUT(self, body):
app = DebugApp(form=to_bytes(body))
return webtest.TestApp(app)
def callFUT(self, filename='form_inputs.html'):
dirname = os.path.join(os.path.dirname(__file__), 'html')
app = DebugApp(form=os.path.join(dirname, filename), show_form=True)
return webtest.TestApp(app)
def callFUT(self):
return webtest.TestApp(DebugApp())
header_name = str(header_name)
header_name = header_name.title()
headers.append((header_name, str(value)))
resp = webob.Response()
resp.status = status
resp.headers.update(headers)
if req.method != 'HEAD':
if isinstance(body, six.text_type):
resp.body = body.encode('utf8')
else:
resp.body = body
return resp(environ, start_response)
debug_app = DebugApp(form=six.b('''
<form method="POST" action="/form-submit">
<input type="text">
<input value="Submit!" type="submit">
</form>'''))
def make_debug_app(global_conf, **local_conf):
"""An application that displays the request environment, and does
nothing else (useful for debugging and test purposes).
"""
return DebugApp(**local_conf)