def test_validation(self):
    self.vc.volume_get.side_effect = self.validate_result
    node = mock.Mock(id='NODE_ID', physical_id='NOVA_ID')
    volume = 'VOLUME'
    if self.success:
        res = self.profile._validate_volume(node, volume, self.reason)
        self.assertIsNotNone(res)
        self.assertEqual(self.result, res.id)
    else:
        ex = self.assertRaises(self.exception, self.profile._validate_volume, node, volume, self.reason)
        self.assertEqual(self.message, six.text_type(ex))
    self.vc.volume_get.assert_called_once_with(volume)
def test_validation(self):
    self.vc.volume_get.side_effect = self.validate_result
    node = mock.Mock(id='NODE_ID', physical_id='NOVA_ID')
    volume = 'VOLUME'
    if self.success:
        res = self.profile._validate_volume(node, volume, self.reason)
        self.assertIsNotNone(res)
        self.assertEqual(self.result, res.id)
    else:
        ex = self.assertRaises(self.exception, self.profile._validate_volume, node, volume, self.reason)
        self.assertEqual(self.message, six.text_type(ex))
    self.vc.volume_get.assert_called_once_with(volume)