Skip to content

Commit

Permalink
update user test
Browse files Browse the repository at this point in the history
  • Loading branch information
gagan-bhullar-tech committed Oct 1, 2024
1 parent c21a030 commit a513d4d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/mocked/test_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,31 @@ def test_databases_get_user(mock_client: Client, mock_client_url):
resp = mock_client.databases.get_user(cluster_uuid, user_name)

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
Expand Down

0 comments on commit a513d4d

Please sign in to comment.