aboutsummaryrefslogtreecommitdiffstats
path: root/docs/pathod/test.rst
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-07 12:55:32 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-07 12:55:32 +1200
commite037fe05ff1f0c2893b3f51e06e0261ca4245d63 (patch)
tree020454af687b48ddc58e0ce4442d78d91e0988ef /docs/pathod/test.rst
parent2b19a33738b20181d7b6ff10a9ffbf6c51ac96c2 (diff)
downloadmitmproxy-e037fe05ff1f0c2893b3f51e06e0261ca4245d63.tar.gz
mitmproxy-e037fe05ff1f0c2893b3f51e06e0261ca4245d63.tar.bz2
mitmproxy-e037fe05ff1f0c2893b3f51e06e0261ca4245d63.zip
Migrate pathod docs to Sphinx
All the content of the pathod docs are moved into Sphinx. The interactive format has not translated well to static docs, and there's still a lot of rewriting, format fixing, structuring, etc to be done.
Diffstat (limited to 'docs/pathod/test.rst')
-rw-r--r--docs/pathod/test.rst35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/pathod/test.rst b/docs/pathod/test.rst
new file mode 100644
index 00000000..cd6e8a29
--- /dev/null
+++ b/docs/pathod/test.rst
@@ -0,0 +1,35 @@
+.. _test:
+
+pathod.test
+===========
+
+The **pathod.test** 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.
+
+The canonical docs can be accessed using pydoc:
+
+>>> pydoc pathod.test
+
+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.
+
+
+Context Manager
+---------------
+
+.. literalinclude:: ../../examples/pathod/test_context.py
+ :caption: examples/pathod/test_context.py
+ :language: python
+
+
+One instance per test
+---------------------
+
+.. literalinclude:: ../../examples/pathod/test_setup.py
+ :caption: examples/pathod/test_setup.py
+ :language: python