mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-17 12:04:46 +00:00
test(ssh): test idempotency of enablement
This commit is contained in:
parent
4e730f015a
commit
1bb24b5f93
1 changed files with 26 additions and 0 deletions
|
@ -173,6 +173,32 @@ def test_graphql_disable_enable_ssh(
|
||||||
assert_includes(api_ssh_settings(authorized_client), output)
|
assert_includes(api_ssh_settings(authorized_client), output)
|
||||||
|
|
||||||
|
|
||||||
|
def test_graphql_disable_twice(authorized_client, some_users, mock_subprocess_popen):
|
||||||
|
output = api_set_ssh_settings(authorized_client, enable=False, password_auth=False)
|
||||||
|
assert_ok(output)
|
||||||
|
assert output["enable"] == False
|
||||||
|
assert output["passwordAuthentication"] == False
|
||||||
|
|
||||||
|
output = api_set_ssh_settings(authorized_client, enable=False, password_auth=False)
|
||||||
|
assert_ok(output)
|
||||||
|
assert output["enable"] == False
|
||||||
|
assert output["passwordAuthentication"] == False
|
||||||
|
|
||||||
|
|
||||||
|
def test_graphql_enable_twice(authorized_client, some_users, mock_subprocess_popen):
|
||||||
|
output = api_set_ssh_settings(authorized_client, enable=True, password_auth=True)
|
||||||
|
assert_ok(output)
|
||||||
|
assert output["enable"] == True
|
||||||
|
assert output["passwordAuthentication"] == True
|
||||||
|
assert_includes(api_ssh_settings(authorized_client), output)
|
||||||
|
|
||||||
|
output = api_set_ssh_settings(authorized_client, enable=True, password_auth=True)
|
||||||
|
assert_ok(output)
|
||||||
|
assert output["enable"] == True
|
||||||
|
assert output["passwordAuthentication"] == True
|
||||||
|
assert_includes(api_ssh_settings(authorized_client), output)
|
||||||
|
|
||||||
|
|
||||||
def test_graphql_add_ssh_key_unauthorized(client, some_users, mock_subprocess_popen):
|
def test_graphql_add_ssh_key_unauthorized(client, some_users, mock_subprocess_popen):
|
||||||
response = client.post(
|
response = client.post(
|
||||||
"/graphql",
|
"/graphql",
|
||||||
|
|
Loading…
Add table
Reference in a new issue