Conditions | 2 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """ |
||
14 | @pytest.fixture |
||
15 | def make_server(): |
||
16 | # Per default, bind to localhost on random user port. |
||
17 | def _wrapper(host='', port=0, *, api_tokens=None): |
||
18 | if api_tokens is None: |
||
19 | api_tokens = set() |
||
20 | config = HttpConfig( |
||
21 | host, |
||
22 | port, |
||
23 | api_tokens=api_tokens, |
||
24 | channel_tokens_to_channel_names={}, |
||
25 | ) |
||
26 | |||
27 | server = create_server(config) |
||
28 | |||
29 | thread = Thread(target=server.handle_request) |
||
30 | thread.start() |
||
31 | |||
32 | return server |
||
33 | |||
34 | return _wrapper |
||
35 |