MCPcopy Index your code
hub / github.com/python-websockets/websockets / setUpClass

Method setUpClass

tests/proxy.py:115–131  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

113
114 @classmethod
115 def setUpClass(cls):
116 super().setUpClass()
117
118 # Ignore deprecation warnings raised by mitmproxy at run time.
119 warnings.filterwarnings(
120 "ignore", category=DeprecationWarning, module="mitmproxy"
121 )
122
123 cls.proxy_ready = threading.Event()
124 cls.proxy_thread = threading.Thread(target=asyncio.run, args=(cls.run_proxy(),))
125 cls.proxy_thread.start()
126 cls.proxy_ready.wait()
127
128 certificate = pathlib.Path(CONF_DIR) / f"{CONF_BASENAME}-ca-cert.pem"
129 certificate = certificate.expanduser()
130 cls.proxy_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
131 cls.proxy_context.load_verify_locations(bytes(certificate))
132
133 def get_http_connects(self):
134 return self.proxy_master.addons.get("recordflows").get_http_connects()

Callers

nothing calls this directly

Calls 1

run_proxyMethod · 0.80

Tested by

no test coverage detected