'Test exception handling when create snapshot in db failed.'

@mock.patch.object(db, 'snapshot_create', side_effect=exception.InvalidSnapshot('Create    snapshot    in    db    failed!'))
def test_create_snapshot_failed_db_snapshot(self, mock_snapshot):

    test_volume = tests_utils.create_volume(self.context, status='available', host=CONF.host)
    volume_api = cinder.volume.api.API()
    self.assertRaises(exception.InvalidSnapshot, volume_api.create_snapshot, self.context, test_volume, 'fake_name', 'fake_description')
