aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_examples.py
diff options
context:
space:
mode:
authorMarcelo Glezer <mg@tekii.com.ar>2014-12-11 14:54:14 -0300
committerMarcelo Glezer <mg@tekii.com.ar>2014-12-11 14:54:14 -0300
commit4952643a0d76eb1e9bd51cbbe95c565ae48b97a2 (patch)
treef43fc647bdfabb522bdef32e21ea4a36404cc311 /test/test_examples.py
parent83b1d4e0e0490e5be05943da459c925a3ee3ff14 (diff)
parentffb95a1db742d71d7671f9e9c6db552774bb0ead (diff)
downloadmitmproxy-4952643a0d76eb1e9bd51cbbe95c565ae48b97a2.tar.gz
mitmproxy-4952643a0d76eb1e9bd51cbbe95c565ae48b97a2.tar.bz2
mitmproxy-4952643a0d76eb1e9bd51cbbe95c565ae48b97a2.zip
Merge remote-tracking branch 'base/master'
Diffstat (limited to 'test/test_examples.py')
-rw-r--r--test/test_examples.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_examples.py b/test/test_examples.py
index fd42e6f0..deb97b49 100644
--- a/test/test_examples.py
+++ b/test/test_examples.py
@@ -1,10 +1,8 @@
import glob
-import mock
from libmproxy import utils, script
from libmproxy.proxy import config
import tservers
-@mock.patch.dict("sys.modules", {"bs4": mock.Mock()})
def test_load_scripts():
example_dir = utils.Data("libmproxy").path("../examples")
scripts = glob.glob("%s/*.py" % example_dir)
@@ -12,8 +10,11 @@ def test_load_scripts():
tmaster = tservers.TestMaster(config.ProxyConfig())
for f in scripts:
+ if "har_extractor" in f:
+ f += " foo"
if "iframe_injector" in f:
f += " foo" # one argument required
if "modify_response_body" in f:
f += " foo bar" # two arguments required
- script.Script(f, tmaster) # Loads the script file. \ No newline at end of file
+ s = script.Script(f, tmaster) # Loads the script file.
+ s.unload() \ No newline at end of file