diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-03 13:54:52 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-03 13:54:52 +1200 |
commit | 5b6d3a80bbb57faa1de1cc7730d28b0678b0bdee (patch) | |
tree | 0f22273c92b0bd89464d66ef49c510aa33273344 /test/tutils.py | |
parent | 67d2993339cb81ff61509c57807df77dde436a3d (diff) | |
download | mitmproxy-5b6d3a80bbb57faa1de1cc7730d28b0678b0bdee.tar.gz mitmproxy-5b6d3a80bbb57faa1de1cc7730d28b0678b0bdee.tar.bz2 mitmproxy-5b6d3a80bbb57faa1de1cc7730d28b0678b0bdee.zip |
websockets: code specification
Diffstat (limited to 'test/tutils.py')
-rw-r--r-- | test/tutils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tutils.py b/test/tutils.py index f188029d..2387e752 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -2,6 +2,7 @@ import tempfile import os import re import shutil +import cStringIO from contextlib import contextmanager from libpathod import utils, test, pathoc, pathod, language import requests @@ -137,3 +138,9 @@ def raises(exc, obj, *args, **kwargs): raise AssertionError("No exception raised.") test_data = utils.Data(__name__) + + +def render(r, settings=language.Settings()): + s = cStringIO.StringIO() + assert language.serve(r, s, settings) + return s.getvalue() |