aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/libpathod/templates/docs_test.html
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-15 23:00:11 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-15 23:00:11 +0100
commit87d9afcf2e257eee7c5aa08c3f0dc64da79b0647 (patch)
tree71b10729d160f0269d02548d1ef9e183be1397d9 /pathod/libpathod/templates/docs_test.html
parent36f34f701991b5d474c005ec45e3b66e20f326a8 (diff)
parent3d9a5157e77b5a3237dc62994f4e3d4c75c2066e (diff)
downloadmitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.tar.gz
mitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.tar.bz2
mitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.zip
Merge pull request #937 from mhils/single-repo
Combine mitmproxy, pathod and netlib in a single repo.
Diffstat (limited to 'pathod/libpathod/templates/docs_test.html')
-rw-r--r--pathod/libpathod/templates/docs_test.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/pathod/libpathod/templates/docs_test.html b/pathod/libpathod/templates/docs_test.html
new file mode 100644
index 00000000..0502c984
--- /dev/null
+++ b/pathod/libpathod/templates/docs_test.html
@@ -0,0 +1,50 @@
+{% extends "docframe.html" %} {% block body %}
+<div class="page-header">
+ <h1>
+ libpathod.test
+ <small>Using libpathod in unit tests.</small>
+ </h1>
+</div>
+
+<p>The <b>libpathod.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 libpathod.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 %}