def test_snapshot_exists(self): v = notifications.Snapshot(mock.Mock()) samples = list(v.process_notification(NOTIFICATION_SNAPSHOT_EXISTS)) self.assertEqual(1, len(samples)) s = samples[0] self._verify_common_sample_snapshot(s, 'snapshot', NOTIFICATION_SNAPSHOT_EXISTS) self.assertEqual(1, s.volume)
def setUp(self): super(TestSnapshotNotifications, self).setUp() self.host = 'snapshots.example.com' self.handler_crud = notifications.SnapshotCRUD(mock.Mock()) self.handler = notifications.Snapshot(mock.Mock()) self.handler_size = notifications.SnapshotSize(mock.Mock()) self.name = 'snapshot' self.name_size = 'snapshot.size' self.size = SNAPSHOT_META['volume_size']