Skip to content

Commit

Permalink
tests/storage_pool: Support old API version on tests
Browse files Browse the repository at this point in the history
Signed-off-by: hamistao <[email protected]>
  • Loading branch information
hamistao committed Jul 5, 2024
1 parent 34e67a5 commit 7c3ff77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions integration/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def test_create_get_restore_delete_volume_snapshot(self):
# Test getting all snapshots with recursion
all_snapshots = volume.snapshots.all(use_recursion=True)
self.assertEqual(first_snapshot, all_snapshots[0])
# Reponses from /1.0/storage-pools/default/volumes/custom/vol/snapshots?recursion=1 in LXD 4.0 has expires_at field as null.
# Setting expires_at manually to avoid breaking next check.
if all_snapshots[0].expires_at is None:
all_snapshots[1].expires_at = custom_snapshot.expires_at

self.assertEqual(custom_snapshot, all_snapshots[1])

# Change snapshot values
Expand Down

0 comments on commit 7c3ff77

Please sign in to comment.