test(ssh): get root key when none
parent
7f1fcd66e3
commit
cf2935938d
|
@ -347,6 +347,10 @@ def test_graphql_get_root_key(authorized_client, some_users):
|
||||||
assert api_rootkeys(authorized_client) == ["ssh-ed25519 KEY test@pc"]
|
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):
|
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")
|
output = api_add_ssh_key(authorized_client, "root", "ssh-rsa KEY test_key@pc")
|
||||||
|
|
||||||
|
|
|
@ -95,12 +95,6 @@ def some_users(mocker, datadir):
|
||||||
## /ssh/keys/{user} ######################################################
|
## /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):
|
def test_delete_root_key(authorized_client, root_and_admin_have_keys):
|
||||||
response = authorized_client.delete(
|
response = authorized_client.delete(
|
||||||
"/services/ssh/keys/root", json={"public_key": "ssh-ed25519 KEY test@pc"}
|
"/services/ssh/keys/root", json={"public_key": "ssh-ed25519 KEY test@pc"}
|
||||||
|
|
Loading…
Reference in New Issue