aboutsummaryrefslogtreecommitdiffstats
path: root/docs/scripting
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2016-12-17 10:29:27 +1300
committerGitHub <noreply@github.com>2016-12-17 10:29:27 +1300
commitfc724b664182195f9cf47dacd95afebc4fb00d87 (patch)
treead78796d792500465f42b9dea5f6a2ad1920a1ea /docs/scripting
parentc4929bbc190a52e4ac0f38492e085338b3e5827d (diff)
parent007aeef770151e48c9265fd9cafb8bc014115d2d (diff)
downloadmitmproxy-fc724b664182195f9cf47dacd95afebc4fb00d87.tar.gz
mitmproxy-fc724b664182195f9cf47dacd95afebc4fb00d87.tar.bz2
mitmproxy-fc724b664182195f9cf47dacd95afebc4fb00d87.zip
Merge pull request #1864 from cortesi/tdocs
Addon test docs, remove stray deprecated events
Diffstat (limited to 'docs/scripting')
-rw-r--r--docs/scripting/overview.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/scripting/overview.rst b/docs/scripting/overview.rst
index 7df5532d..84f2135e 100644
--- a/docs/scripting/overview.rst
+++ b/docs/scripting/overview.rst
@@ -131,6 +131,23 @@ purposes. You can use it as follows:
:language: python
+Testing
+-------
+
+Mitmproxy includes a number of helpers for testing addons. The
+``mitmproxy.test.taddons`` module contains a context helper that takes care of
+setting up and tearing down the addon event context. The
+``mitmproxy.test.tflow`` module contains helpers for quickly creating test
+flows. Pydoc is the canonical reference for these modules, and mitmproxy's own
+test suite is an excellent source of examples of usage. Here, for instance, is
+the mitmproxy unit tests for the `anticache` option, demonstrating a good
+cross-section of the test helpers:
+
+.. literalinclude:: ../../test/mitmproxy/addons/test_anticache.py
+ :caption: :src:`test/mitmproxy/addons/test_anticache.py`
+ :language: python
+
+
Developing scripts
------------------