MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_state

Method test_state

test/mitmproxy/test_connection.py:52–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50 assert str(c) == "Client(127.0.0.1:52314, state=closed, alpn=foo)"
51
52 def test_state(self):
53 c = tclient_conn()
54 assert Client.from_state(c.get_state()).get_state() == c.get_state()
55
56 c2 = tclient_conn()
57 assert c != c2
58
59 c2.timestamp_start = 42
60 c.set_state(c2.get_state())
61 assert c.timestamp_start == 42
62
63 c3 = c.copy()
64 assert c3.get_state() != c.get_state()
65 c.id = c3.id = "foo"
66 assert c3.get_state() == c.get_state()
67
68
69class TestServer:

Callers

nothing calls this directly

Calls 5

tclient_connFunction · 0.90
get_stateMethod · 0.45
from_stateMethod · 0.45
set_stateMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected