Test HAProxy stop functionality.
(haproxy_api_cleanup)
| 1336 | |
| 1337 | @pytest.mark.asyncio |
| 1338 | async def test_stop(haproxy_api_cleanup): |
| 1339 | """Test HAProxy stop functionality.""" |
| 1340 | with tempfile.TemporaryDirectory() as temp_dir: |
| 1341 | config_file_path = os.path.join(temp_dir, "haproxy.cfg") |
| 1342 | |
| 1343 | config = HAProxyConfig( |
| 1344 | http_options=HTTPOptions( |
| 1345 | host="127.0.0.1", |
| 1346 | port=8000, |
| 1347 | ), |
| 1348 | stats_port=8404, |
| 1349 | socket_path=os.path.join(temp_dir, "admin.sock"), |
| 1350 | ) |
| 1351 | |
| 1352 | api = HAProxyApi(cfg=config, config_file_path=config_file_path) |
| 1353 | |
| 1354 | haproxy_api_cleanup(api) |
| 1355 | |
| 1356 | # Start HAProxy |
| 1357 | await api.start() |
| 1358 | |
| 1359 | haproxy_api_cleanup(api) |
| 1360 | |
| 1361 | await api.stop() |
| 1362 | |
| 1363 | # Verify it's stopped |
| 1364 | assert not api._is_running(), "HAProxy should be stopped after shutdown" |
| 1365 | |
| 1366 | |
| 1367 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected
searching dependent graphs…