diff options
| author | Maximilian Hils <git@maximilianhils.com> | 2016-07-08 19:57:57 -0700 | 
|---|---|---|
| committer | Maximilian Hils <git@maximilianhils.com> | 2016-07-08 19:57:57 -0700 | 
| commit | 5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2 (patch) | |
| tree | 01d2f83583f0a47706def85b9ed82ed045d5f4b6 /test | |
| parent | 7c67faa8da39f428d1860bccae806137943b66a6 (diff) | |
| download | mitmproxy-5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2.tar.gz mitmproxy-5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2.tar.bz2 mitmproxy-5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2.zip  | |
move script context to mitmproxy.ctx
Diffstat (limited to 'test')
| -rw-r--r-- | test/mitmproxy/data/scripts/all.py | 14 | ||||
| -rw-r--r-- | test/mitmproxy/data/scripts/duplicate_flow.py | 4 | ||||
| -rw-r--r-- | test/mitmproxy/test_examples.py | 6 | 
3 files changed, 12 insertions, 12 deletions
diff --git a/test/mitmproxy/data/scripts/all.py b/test/mitmproxy/data/scripts/all.py index 17ffe33f..bf8e93ec 100644 --- a/test/mitmproxy/data/scripts/all.py +++ b/test/mitmproxy/data/scripts/all.py @@ -3,35 +3,35 @@ log = []  def clientconnect(cc): -    mitmproxy.log("XCLIENTCONNECT") +    mitmproxy.ctx.log("XCLIENTCONNECT")      log.append("clientconnect")  def serverconnect(cc): -    mitmproxy.log("XSERVERCONNECT") +    mitmproxy.ctx.log("XSERVERCONNECT")      log.append("serverconnect")  def request(f): -    mitmproxy.log("XREQUEST") +    mitmproxy.ctx.log("XREQUEST")      log.append("request")  def response(f): -    mitmproxy.log("XRESPONSE") +    mitmproxy.ctx.log("XRESPONSE")      log.append("response")  def responseheaders(f): -    mitmproxy.log("XRESPONSEHEADERS") +    mitmproxy.ctx.log("XRESPONSEHEADERS")      log.append("responseheaders")  def clientdisconnect(cc): -    mitmproxy.log("XCLIENTDISCONNECT") +    mitmproxy.ctx.log("XCLIENTDISCONNECT")      log.append("clientdisconnect")  def error(cc): -    mitmproxy.log("XERROR") +    mitmproxy.ctx.log("XERROR")      log.append("error") diff --git a/test/mitmproxy/data/scripts/duplicate_flow.py b/test/mitmproxy/data/scripts/duplicate_flow.py index a50d2cb5..565b1845 100644 --- a/test/mitmproxy/data/scripts/duplicate_flow.py +++ b/test/mitmproxy/data/scripts/duplicate_flow.py @@ -2,5 +2,5 @@ import mitmproxy  def request(f): -    f = mitmproxy.master.duplicate_flow(f) -    mitmproxy.master.replay_request(f, block=True, run_scripthooks=False) +    f = mitmproxy.ctx.master.duplicate_flow(f) +    mitmproxy.ctx.master.replay_request(f, block=True, run_scripthooks=False) diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py index 3b5ff2a2..bdadcd11 100644 --- a/test/mitmproxy/test_examples.py +++ b/test/mitmproxy/test_examples.py @@ -21,8 +21,8 @@ def example(command):          yield s -@mock.patch("mitmproxy.master") -@mock.patch("mitmproxy.log") +@mock.patch("mitmproxy.ctx.master") +@mock.patch("mitmproxy.ctx.log")  def test_load_scripts(log, master):      scripts = glob.glob("%s/*.py" % example_dir) @@ -121,7 +121,7 @@ def test_redirect_requests():          assert flow.request.host == "mitmproxy.org" -@mock.patch("mitmproxy.log") +@mock.patch("mitmproxy.ctx.log")  def test_har_extractor(log):      if sys.version_info >= (3, 0):          with tutils.raises("does not work on Python 3"):  | 
