Skip to content

Commit

Permalink
test: list supported backup policies (#353)
Browse files Browse the repository at this point in the history
* list supported backup policies test

* fix

* review comments

Co-authored-by: Anna Lushnikova <loosla@users.noreply.github.com>

---------

Co-authored-by: Anna Lushnikova <loosla@users.noreply.github.com>
  • Loading branch information
gagan-bhullar-tech and loosla authored Oct 1, 2024
1 parent 161c16e commit 7ce1d91
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/mocked/test_droplets.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,39 @@ def test_list_snapshots(mock_client: Client, mock_client_url):
assert expected == resp


@responses.activate
def list_supported_backup_policies(mock_client: Client, mock_client_url):
"""Mocks the list of supported backup policies."""

expected = {
"supported_policies": [
{
"name": "weekly",
"possible_window_starts": [],
"window_length_hours": 2,
"retention_period_days": 20,
},
{
"name": "daily",
"possible_window_starts": [],
"window_length_hours": 3,
"retention_period_days": 9,
},
],
}

responses.add(
responses.GET,
f"{mock_client_url}/v2/droplets/backups/supported_policies",
json=expected,
status=200,
)

resp = mock_client.droplets.list_supported_backup_policies()

assert expected == resp


@responses.activate
def test_list_kernels(mock_client: Client, mock_client_url):
"""Mocks the droplets list kernels operation."""
Expand Down

0 comments on commit 7ce1d91

Please sign in to comment.