From e6e28c2ac37652ad21cf7a4e351c419fffa10f4b Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 6 Nov 2017 15:24:54 +0100 Subject: fix revert of duplicated flows --- test/mitmproxy/test_flow.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') 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): -- cgit v1.2.3