test(ssh): remove root key

remove-rest
Houkime 2023-12-21 08:48:29 +00:00
parent cf2935938d
commit 8fc7796da0
2 changed files with 1 additions and 20 deletions

View File

@ -522,9 +522,7 @@ def test_graphql_remove_ssh_key(authorized_client, some_users, mock_subprocess_p
assert response.json()["data"]["users"]["removeSshKey"]["user"]["sshKeys"] == []
def test_graphql_remove_root_ssh_key(
authorized_client, some_users, mock_subprocess_popen
):
def test_graphql_remove_root_ssh_key(authorized_client, some_users):
response = authorized_client.post(
"/graphql",
json={

View File

@ -95,23 +95,6 @@ def some_users(mocker, datadir):
## /ssh/keys/{user} ######################################################
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"}
)
assert response.status_code == 200
assert (
"rootKeys"
not in read_json(root_and_admin_have_keys / "root_and_admin_have_keys.json")[
"ssh"
]
or read_json(root_and_admin_have_keys / "root_and_admin_have_keys.json")["ssh"][
"rootKeys"
]
== []
)
def test_delete_root_nonexistent_key(authorized_client, root_and_admin_have_keys):
response = authorized_client.delete(
"/services/ssh/keys/root", json={"public_key": "ssh-rsa KEY test@pc"}