()
| 21 | |
| 22 | |
| 23 | def test_make(): |
| 24 | manager = Mock() |
| 25 | context = MagicMock() |
| 26 | assert ServerInstance.make("regular", manager) |
| 27 | |
| 28 | for mode in [ |
| 29 | "regular", |
| 30 | # "http3", |
| 31 | "upstream:example.com", |
| 32 | "transparent", |
| 33 | "reverse:example.com", |
| 34 | "socks5", |
| 35 | ]: |
| 36 | inst = ServerInstance.make(mode, manager) |
| 37 | assert inst |
| 38 | assert inst.make_top_layer(context) |
| 39 | assert inst.mode.description |
| 40 | assert inst.to_json() |
| 41 | |
| 42 | with pytest.raises( |
| 43 | ValueError, match="is not a spec for a WireGuardServerInstance server." |
| 44 | ): |
| 45 | WireGuardServerInstance.make("regular", manager) |
| 46 | |
| 47 | |
| 48 | async def test_last_exception_and_running(monkeypatch): |
nothing calls this directly
no test coverage detected
searching dependent graphs…