mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 12:11:26 +00:00
test(ssh): remove root key
This commit is contained in:
parent
cf2935938d
commit
8fc7796da0
|
@ -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={
|
||||
|
|
|
@ -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"}
|
||||
|
|
Loading…
Reference in a new issue