MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_copy

Method test_copy

test/mitmproxy/test_http.py:642–668  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

640
641class TestHTTPFlow:
642 def test_copy(self):
643 f = tflow(resp=True)
644 assert repr(f)
645 f.get_state()
646 f2 = f.copy()
647 a = f.get_state()
648 b = f2.get_state()
649 del a["id"]
650 del b["id"]
651 assert a == b
652 assert not f == f2
653 assert f is not f2
654 assert f.request.get_state() == f2.request.get_state()
655 assert f.request is not f2.request
656 assert f.request.headers == f2.request.headers
657 assert f.request.headers is not f2.request.headers
658 assert f.response.get_state() == f2.response.get_state()
659 assert f.response is not f2.response
660
661 f = tflow(err=True)
662 f2 = f.copy()
663 assert f is not f2
664 assert f.request is not f2.request
665 assert f.request.headers == f2.request.headers
666 assert f.request.headers is not f2.request.headers
667 assert f.error.get_state() == f2.error.get_state()
668 assert f.error is not f2.error
669
670 def test_match(self):
671 f = tflow(resp=True)

Callers

nothing calls this directly

Calls 3

tflowFunction · 0.90
get_stateMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected