"""reboot_host: restart the Proxmox node itself through the API, not over SSH.""" from __future__ import annotations import pytest def test_posts_reboot_to_the_node(driver): driver.reboot_host() driver._node_api().status.post.assert_called_once_with(command="reboot") def test_api_refusal_is_a_runtime_error(driver): driver._node_api().status.post.side_effect = Exception("Permission check failed") with pytest.raises(RuntimeError, match="Permission check failed"): driver.reboot_host()