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: list supported backup policies #353

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
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
Loading