From de625c16fa9e59e4e335364565e74a034b766ff9 Mon Sep 17 00:00:00 2001 From: Bin Sun Date: Sun, 8 Apr 2018 11:17:58 +0800 Subject: Add list image test Change-Id: I5ddffdc638be3eb3777a87ec19f5d35223a4cfd2 Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun --- vio/vio/tests/test_fake_image_view.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vio') diff --git a/vio/vio/tests/test_fake_image_view.py b/vio/vio/tests/test_fake_image_view.py index d1e666c..feb3569 100644 --- a/vio/vio/tests/test_fake_image_view.py +++ b/vio/vio/tests/test_fake_image_view.py @@ -29,3 +29,17 @@ class TestFakeImageDetail(unittest.TestCase): } resp = self.view.get(mock.Mock(), "1234abcd") self.assertEqual(200, resp.status_code) + + +class TestFakeImage(unittest.TestCase): + + def setUp(self): + self.view = views.FakeImage() + + @mock.patch.object(fakeResponse, "list_image") + def test_get(self, mock_list_image): + mock_list_image.return_value = { + "images": [{"id": "1234abcd"}] + } + resp = self.view.get(mock.Mock()) + self.assertEqual(200, resp.status_code) -- cgit 1.2.3-korg