Skip to content

Commit

Permalink
Update test_server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
delinea-rajani authored Jul 1, 2024
1 parent 5ec4144 commit dbee7b9
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SecretServerClientError,
SecretServerError,
ServerSecret,
ServerFolder,
)


Expand All @@ -31,7 +32,6 @@ def test_api_url(secret_server, env_vars):
== f"https://{env_vars['tenant']}.secretservercloud.com/api/v1"
)


def test_access_token_authorizer(env_vars, authorizer):
assert SecretServer(
f"https://{env_vars['tenant']}.secretservercloud.com/",
Expand All @@ -51,10 +51,28 @@ def test_server_secret_by_path(env_vars, secret_server):
).id == int(env_vars["secret_id"])


def test_server_folder_by_path(env_vars, secret_server):
assert ServerFolder(
**secret_server.get_folder_by_path(env_vars["folder_path"])
).id == int(env_vars["folder_id"])


def test_nonexistent_secret(secret_server):
with pytest.raises(SecretServerClientError):
secret_server.get_secret(1000)


def test_nonexistent_folder(secret_server):
with pytest.raises(SecretServerClientError):
secret_server.get_folder(1000)


def test_server_secret_ids_by_folderid(env_vars, secret_server):
assert type(secret_server.get_secret_ids_by_folderid(env_vars["folder_id"])) is list


def test_server_child_folder_ids_by_folderid(env_vars, secret_server):
assert (
type(secret_server.get_child_folder_ids_by_folderid(env_vars["folder_id"]))
is list
)

0 comments on commit dbee7b9

Please sign in to comment.