test(ssh): get root key when none

remove-rest
Houkime 2023-12-21 08:24:17 +00:00
parent 7f1fcd66e3
commit cf2935938d
2 changed files with 4 additions and 6 deletions

View File

@ -347,6 +347,10 @@ def test_graphql_get_root_key(authorized_client, some_users):
assert api_rootkeys(authorized_client) == ["ssh-ed25519 KEY test@pc"]
def test_graphql_get_root_key_when_none(authorized_client, no_rootkeys):
assert api_rootkeys(authorized_client) == []
def test_graphql_add_root_ssh_key(authorized_client, no_rootkeys):
output = api_add_ssh_key(authorized_client, "root", "ssh-rsa KEY test_key@pc")

View File

@ -95,12 +95,6 @@ def some_users(mocker, datadir):
## /ssh/keys/{user} ######################################################
def test_get_root_key_when_none(authorized_client, ssh_on):
response = authorized_client.get("/services/ssh/keys/root")
assert response.status_code == 200
assert response.json() == []
def test_delete_root_key(authorized_client, root_and_admin_have_keys):
response = authorized_client.delete(
"/services/ssh/keys/root", json={"public_key": "ssh-ed25519 KEY test@pc"}