|
|
@@ -24,16 +24,15 @@ class AzureSnapshotsServiceTestCase(ProviderTestBase):
|
|
|
self.assertIsNotNone(snapshot.volume_id)
|
|
|
self.assertIsNotNone(snapshot.create_time)
|
|
|
snapshot.name = 'MySnapNewName'
|
|
|
- with self.assertRaises(NotImplementedError):
|
|
|
- snapshot = self.provider.block_store.snapshots.get(
|
|
|
+ snapshot = self.provider.block_store.snapshots.get(
|
|
|
"/subscriptions/7904d702-e01c-4826-8519-f5a25c866a96'\
|
|
|
'/resourceGroups/cloudbridge-azure'\
|
|
|
'/providers/Microsoft.Compute'\
|
|
|
/snapshots/MySnapshot")
|
|
|
- print("Get Snapshot - " + str(snapshot))
|
|
|
- self.assertTrue(
|
|
|
- snapshot.name == "MySnapshot",
|
|
|
- "Snapshot name should be MySnapshot")
|
|
|
+ print("Get Snapshot - " + str(snapshot))
|
|
|
+ self.assertTrue(
|
|
|
+ snapshot.name == "MySnapshot",
|
|
|
+ "Snapshot name should be MySnapshot")
|
|
|
|
|
|
snapshot.delete()
|
|
|
|
|
|
@@ -58,13 +57,12 @@ class AzureSnapshotsServiceTestCase(ProviderTestBase):
|
|
|
snapshot.refresh()
|
|
|
self.assertEqual(snapshot.state, SnapshotState.UNKNOWN)
|
|
|
|
|
|
- with self.assertRaises(NotImplementedError):
|
|
|
- snapshot_id = "/subscriptions/7904d702-e01c-4826-8519-f5a25c866a96'\
|
|
|
+ snapshot_id = "/subscriptions/7904d702-e01c-4826-8519-f5a25c866a96'\
|
|
|
'/resourceGroups/cloudbridge-azure'\
|
|
|
'/providers/Microsoft.Compute/snapshots/MySnapshot"
|
|
|
- snapshot1 = self.provider.block_store.snapshots.get(snapshot_id)
|
|
|
- self.assertTrue(
|
|
|
- snapshot1 is None, "Snapshot still exists")
|
|
|
+ snapshot1 = self.provider.block_store.snapshots.get(snapshot_id)
|
|
|
+ self.assertTrue(
|
|
|
+ snapshot1 is None, "Snapshot still exists")
|
|
|
|
|
|
@helpers.skipIfNoService(['block_store.snapshots'])
|
|
|
def test_azure_snapshot_create_volume(self):
|
|
|
@@ -88,13 +86,12 @@ class AzureSnapshotsServiceTestCase(ProviderTestBase):
|
|
|
|
|
|
@helpers.skipIfNoService(['block_store.snapshots'])
|
|
|
def test_azure_snapshot_get_ifNotExist(self):
|
|
|
- with self.assertRaises(NotImplementedError):
|
|
|
- snapshot_id = "/subscriptions/7904d702-e01c-4826-8519-f5a25c866a96'\
|
|
|
+ snapshot_id = "/subscriptions/7904d702-e01c-4826-8519-f5a25c866a96'\
|
|
|
'/resourceGroups/cloudbridge-azure'\
|
|
|
'/providers/Microsoft.Compute/snapshots/MySnapshot123"
|
|
|
- snapshot = self.provider.block_store.snapshots.get(snapshot_id)
|
|
|
- self.assertTrue(
|
|
|
- snapshot is None, "Snapshot should not be available")
|
|
|
+ snapshot = self.provider.block_store.snapshots.get(snapshot_id)
|
|
|
+ self.assertTrue(
|
|
|
+ snapshot is None, "Snapshot should not be available")
|
|
|
|
|
|
@helpers.skipIfNoService(['block_store.snapshots'])
|
|
|
def test_azure_snapshot_find(self):
|