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

Method test_state

test/mitmproxy/test_certs.py:370–384  ·  view source on GitHub ↗
(self, tdata)

Source from the content-addressed store, hash-verified

368 assert c.altnames is not None
369
370 def test_state(self, tdata):
371 with open(tdata.path("mitmproxy/net/data/text_cert"), "rb") as f:
372 d = f.read()
373 c = certs.Cert.from_pem(d)
374
375 c.get_state()
376 c2 = c.copy()
377 a = c.get_state()
378 b = c2.get_state()
379 assert a == b
380 assert c == c2
381 assert c is not c2
382
383 c2.set_state(a)
384 assert c == c2
385
386 def test_add_cert_overrides(self, tdata, tstore):
387 certfile = Path(

Callers

nothing calls this directly

Calls 6

from_pemMethod · 0.80
pathMethod · 0.45
readMethod · 0.45
get_stateMethod · 0.45
copyMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected