summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 10:33:38 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 10:33:38 +0800
commitb0a8f3d8b611f96404850a1baf31a1d63dfbc49d (patch)
tree590fce88b67d8bef661d873a6a02f33595e8f47a
parent7c964e6e09714591b4e69743362037df1f9bd9cd (diff)
Add test_del_vim_fail
Add test_del_vim_fail Change-Id: I7858bb3acf39e2eab67f4f744a3906b13df03c2d Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r--vio/vio/tests/test_aai_client.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/vio/vio/tests/test_aai_client.py b/vio/vio/tests/test_aai_client.py
index 1bf79d1..3e1f515 100644
--- a/vio/vio/tests/test_aai_client.py
+++ b/vio/vio/tests/test_aai_client.py
@@ -13,6 +13,7 @@
import mock
import unittest
+from vio.pub.exceptions import VimDriverVioException
from vio.pub.utils import restcall
@@ -178,3 +179,13 @@ class TestAAIClient(unittest.TestCase):
mock_call.return_value = [0, "", "", ""]
self.view.delete_vim()
mock_call.assert_called_once()
+
+ @mock.patch.object(restcall, "call_req")
+ def test_del_vim_fail(self, mock_call):
+ resp = {
+ "resource-version": "1"
+ }
+ self.view.get_vim = mock.MagicMock()
+ self.view.get_vim.return_value = resp
+ mock_call.return_value = [1, "", "", ""]
+ self.assertRaises(VimDriverVioException, self.view.delete_vim)