Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: update user mock #348

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/mocked/test_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,29 @@ def test_databases_get_user(mock_client: Client, mock_client_url):
assert expected == resp


@responses.activate
def test_databases_update_user(mock_client: Client, mock_client_url):
"""Mocks the databases update user method."""

expected = {"user": {"name": "app-01"}}

cluster_uuid = "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"
user_name = "app-01"

responses.add(
responses.PUT,
f"{mock_client_url}/v2/databases/{cluster_uuid}/users/{user_name}",
json=expected,
status=201,
)

resp = mock_client.databases.update_user(
cluster_uuid, user_name, {"user": {"name": "app-01"}}
)

assert expected == resp


@responses.activate
def test_databases_list(mock_client: Client, mock_client_url):
"""Mocks the databases list operation"""
Expand Down
Loading