diff options
| author | Maximilian Hils <git@maximilianhils.com> | 2017-11-16 18:33:08 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-16 18:33:08 +1100 |
| commit | 168c72a55f82d24c1dc332cb44a9fe4a0d57f8ce (patch) | |
| tree | 6f5fade0fda14e80583c5771ad6868ae50509f4d /test | |
| parent | 59af6af0f787aef6d56152490eae2a329ad0e681 (diff) | |
| parent | 4a2a718bc291b3f720e955b1c4bc10b4a292dfd0 (diff) | |
| download | mitmproxy-168c72a55f82d24c1dc332cb44a9fe4a0d57f8ce.tar.gz mitmproxy-168c72a55f82d24c1dc332cb44a9fe4a0d57f8ce.tar.bz2 mitmproxy-168c72a55f82d24c1dc332cb44a9fe4a0d57f8ce.zip | |
Merge pull request #2621 from mhils/clientreplay
Improve Clientreplay
Diffstat (limited to 'test')
| -rw-r--r-- | test/mitmproxy/addons/test_clientplayback.py | 7 | ||||
| -rw-r--r-- | test/mitmproxy/test_flow.py | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/test/mitmproxy/addons/test_clientplayback.py b/test/mitmproxy/addons/test_clientplayback.py index 6089b2d5..2dc7eb92 100644 --- a/test/mitmproxy/addons/test_clientplayback.py +++ b/test/mitmproxy/addons/test_clientplayback.py @@ -36,9 +36,12 @@ class TestClientPlayback: assert rp.called assert cp.current_thread - cp.flows = None - cp.current_thread = None + cp.flows = [] + cp.current_thread.is_alive.return_value = False + assert cp.count() == 1 cp.tick() + assert cp.count() == 0 + assert tctx.master.has_event("update") assert tctx.master.has_event("processing_complete") cp.current_thread = MockThread() diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index 7f9d577b..fcc766b5 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -84,6 +84,17 @@ class TestSerialize: with pytest.raises(Exception, match="version"): list(r.stream()) + def test_copy(self): + """ + _backup may be shared across instances. That should not raise errors. + """ + f = tflow.tflow() + f.backup() + f.request.path = "/foo" + f2 = f.copy() + f2.revert() + f.revert() + class TestFlowMaster: def test_load_flow_reverse(self): |
