MCPcopy Create free account
hub / github.com/Vinyzu/Botright / __init__

Method __init__

tests/server.py:114–124  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 protocol = "http"
113
114 def __init__(self) -> None:
115 self.PORT = find_free_port()
116 self.EMPTY_PAGE = f"{self.protocol}://localhost:{self.PORT}/empty.html"
117 self.PREFIX = f"{self.protocol}://localhost:{self.PORT}"
118 self.CROSS_PROCESS_PREFIX = f"{self.protocol}://127.0.0.1:{self.PORT}"
119 # On Windows, this list can be empty, reporting text/plain for scripts.
120 mimetypes.add_type("text/html", ".html")
121 mimetypes.add_type("text/css", ".css")
122 mimetypes.add_type("application/javascript", ".js")
123 mimetypes.add_type("image/png", ".png")
124 mimetypes.add_type("font/woff2", ".woff2")
125
126 def __repr__(self) -> str:
127 return self.PREFIX

Callers

nothing calls this directly

Calls 1

find_free_portFunction · 0.85

Tested by

no test coverage detected