MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / test_main

Function test_main

tests/api_utils/test_stream.py:150–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148
149@pytest.mark.asyncio
150async def test_main():
151 with (
152 patch("stream.main.parse_args") as mock_parse,
153 patch("stream.main.ProxyServer") as mock_cls,
154 patch("pathlib.Path.mkdir", MagicMock()),
155 ):
156 mock_parse.return_value = argparse.Namespace(
157 host="127.0.0.1", port=3120, domains=["*.google.com"], proxy=None
158 )
159
160 mock_instance = AsyncMock()
161 mock_cls.return_value = mock_instance
162
163 await main()
164
165 mock_cls.assert_called_once()
166 mock_instance.start.assert_called_once()
167
168
169@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 1

mainFunction · 0.90

Tested by

no test coverage detected