MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_getset_state

Method test_getset_state

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

Source from the content-addressed store, hash-verified

698 f.revert()
699
700 def test_getset_state(self):
701 f = tflow(resp=True)
702 state = f.get_state()
703 assert f.get_state() == HTTPFlow.from_state(state).get_state()
704
705 f.response = None
706 f.error = flow.Error("error")
707 state = f.get_state()
708 assert f.get_state() == HTTPFlow.from_state(state).get_state()
709
710 f2 = f.copy()
711 f2.id = f.id # copy creates a different uuid
712 assert f.get_state() == f2.get_state()
713 assert not f == f2
714 f2.error = flow.Error("e2")
715 assert not f == f2
716 f2.backup()
717 f2.intercept() # to change the state
718 f.set_state(f2.get_state())
719 assert f.get_state() == f2.get_state()
720
721 def test_kill(self):
722 f = tflow()

Callers

nothing calls this directly

Calls 7

tflowFunction · 0.90
backupMethod · 0.80
get_stateMethod · 0.45
from_stateMethod · 0.45
copyMethod · 0.45
interceptMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected