api/machines: allow config verification on imaginary machines
Machines do not need to exist in order to verify their configuration. This allows verifying a config before creating an actual machine with it.
This commit is contained in:
@@ -62,6 +62,18 @@ def test_create_machine_invalid_hostname(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.with_core
|
||||
def test_verify_config_without_machine(
|
||||
api: TestClient, test_flake_with_core: FlakeForTest
|
||||
) -> None:
|
||||
response = api.put(
|
||||
f"/api/{test_flake_with_core.name}/machines/test/verify",
|
||||
json=dict(),
|
||||
)
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"success": True, "error": None}
|
||||
|
||||
|
||||
@pytest.mark.with_core
|
||||
def test_configure_machine(api: TestClient, test_flake_with_core: FlakeForTest) -> None:
|
||||
# ensure error 404 if machine does not exist when accessing the config
|
||||
|
||||
Reference in New Issue
Block a user