diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-18 13:03:40 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-18 13:03:40 +0100 |
commit | d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7 (patch) | |
tree | fe8856f65d1dafa946150c5acbaf6e942ba3c026 /pathod/templates/docs_test.html | |
parent | 294774d6f0dee95b02a93307ec493b111b7f171e (diff) | |
download | mitmproxy-d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7.tar.gz mitmproxy-d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7.tar.bz2 mitmproxy-d33d3663ecb166461d9cb5a78a29b44ee7a8fbb7.zip |
combine projects
Diffstat (limited to 'pathod/templates/docs_test.html')
-rw-r--r-- | pathod/templates/docs_test.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/pathod/templates/docs_test.html b/pathod/templates/docs_test.html new file mode 100644 index 00000000..ecd84bc7 --- /dev/null +++ b/pathod/templates/docs_test.html @@ -0,0 +1,50 @@ +{% extends "docframe.html" %} {% block body %} +<div class="page-header"> + <h1> + pathod.test + <small>Using pathod in unit tests.</small> + </h1> +</div> + +<p>The <b>pathod.test</b> module is a light, flexible testing layer for HTTP clients. + It works by firing up a Pathod instance in a separate thread, letting you use + Pathod's full abilities to generate responses, and then query Pathod's internal + logs to establish what happened. All the mechanics of startup, shutdown, finding + free ports and so forth are taken care of for you. +</p> + +<p>The canonical docs can be accessed using pydoc: </p> + +<pre class="terminal">pydoc pathod.test</pre> + +<p> + The remainder of this page demonstrates some common interaction patterns using + <a href="http://nose.readthedocs.org/en/latest/">nose</a>. These examples are + also applicable with only minor modification to most commonly used Python testing + engines. +</p> + +<section> + <div class="page-header"> + <h1>Context Manager</h1> + </div> + + {% include "examples_context.html" %} +</section> + +<section> + <div class="page-header"> + <h1>One instance per test</h1> + </div> + + {% include "examples_setup.html" %} +</section> + +<section> + <div class="page-header"> + <h1>One instance per suite</h1> + </div> + + {% include "examples_setupall.html" %} +</section> +{% endblock %} |