From d17cd5c6eca72fdddafb73028687c8b0152a5fe6 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Fri, 4 Mar 2016 03:13:40 +0530 Subject: Use custom Context object --- test/mitmproxy/test_har_extractor.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/test_har_extractor.py b/test/mitmproxy/test_har_extractor.py index 26a092e6..7838f713 100644 --- a/test/mitmproxy/test_har_extractor.py +++ b/test/mitmproxy/test_har_extractor.py @@ -2,10 +2,13 @@ import json import netlib.tutils from . import tutils -from mitmproxy import script, flow from examples import har_extractor +class Context(object): + pass + + trequest = netlib.tutils.treq( timestamp_start=746203272, timestamp_end=746203272, @@ -18,14 +21,11 @@ tresponse = netlib.tutils.tresp( def test_start(): - fm = flow.FlowMaster(None, flow.State()) - ctx = script.ScriptContext(fm) - tutils.raises(ValueError, har_extractor.start, ctx, []) + tutils.raises(ValueError, har_extractor.start, Context(), []) def test_response(): - fm = flow.FlowMaster(None, flow.State()) - ctx = script.ScriptContext(fm) + ctx = Context() ctx.HARLog = har_extractor._HARLog([]) ctx.seen_server = set() -- cgit v1.2.3