mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +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"] == []
|
assert response.json()["data"]["users"]["removeSshKey"]["user"]["sshKeys"] == []
|
||||||
|
|
||||||
|
|
||||||
def test_graphql_remove_root_ssh_key(
|
def test_graphql_remove_root_ssh_key(authorized_client, some_users):
|
||||||
authorized_client, some_users, mock_subprocess_popen
|
|
||||||
):
|
|
||||||
response = authorized_client.post(
|
response = authorized_client.post(
|
||||||
"/graphql",
|
"/graphql",
|
||||||
json={
|
json={
|
||||||
|
|
|
@ -95,23 +95,6 @@ def some_users(mocker, datadir):
|
||||||
## /ssh/keys/{user} ######################################################
|
## /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):
|
def test_delete_root_nonexistent_key(authorized_client, root_and_admin_have_keys):
|
||||||
response = authorized_client.delete(
|
response = authorized_client.delete(
|
||||||
"/services/ssh/keys/root", json={"public_key": "ssh-rsa KEY test@pc"}
|
"/services/ssh/keys/root", json={"public_key": "ssh-rsa KEY test@pc"}
|
||||||
|
|
Loading…
Reference in a new issue