diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-27 15:16:15 -0700 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2018-03-27 15:16:15 -0700 |
commit | b5c12fa218572e79a62394b3fd9f6620aa409da1 (patch) | |
tree | 6a623e855012145debe8ba27c027d9f510f7d5b0 | |
parent | 3c5a3d7b5a2f7f6e89a93f0119ad9fbb45d2ff34 (diff) |
Add test_delete for ImageView
Add test_delete
Change-Id: I69763ef2b1b81379c4a6c2597f7cb62e9476516c
Issue-ID: MULTICLOUD-199
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r-- | vio/vio/tests/test_image_view.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vio/vio/tests/test_image_view.py b/vio/vio/tests/test_image_view.py index 5466d08..989eb33 100644 --- a/vio/vio/tests/test_image_view.py +++ b/vio/vio/tests/test_image_view.py @@ -37,3 +37,14 @@ class TestGetDeleteImageView(unittest.TestCase): resp = self.view.get(mock.Mock(), "vmware_nova", "tenant1", "image1") self.assertEqual(200, resp.status_code) self.assertEqual("image-id", resp.data.get('id')) + + @mock.patch.object(OperateImage.OperateImage, "delete_vim_image") + @mock.patch.object(extsys, "get_vim_by_id") + def test_delete(self, mock_getvim, mock_delimg): + mock_getvim.return_value = { + "tenant": "tenant-id" + } + resp = self.view.delete( + mock.Mock(), "vmware_nova", "tenant1", "image1") + self.assertEqual(204, resp.status_code) + mock_delimg.assert_called_once() |