def test_validation(self):
    self.cc.validate_azs.side_effect = self.validate_result
    node = mock.Mock(id='NODE_ID')
    if self.success:
        res = self.profile._validate_az(node, 'FAKE_AZ', self.reason)
        self.assertEqual(self.result, res)
    else:
        ex = self.assertRaises(self.exception, self.profile._validate_az, node, 'FAKE_AZ', self.reason)
        self.assertEqual(self.message, six.text_type(ex))
    self.cc.validate_azs.assert_called_once_with(['FAKE_AZ'])
def test_validation(self):
    self.cc.validate_azs.side_effect = self.validate_result
    node = mock.Mock(id='NODE_ID')
    if self.success:
        res = self.profile._validate_az(node, 'FAKE_AZ', self.reason)
        self.assertEqual(self.result, res)
    else:
        ex = self.assertRaises(self.exception, self.profile._validate_az, node, 'FAKE_AZ', self.reason)
        self.assertEqual(self.message, six.text_type(ex))
    self.cc.validate_azs.assert_called_once_with(['FAKE_AZ'])