diff options
author | Bin Sun <bins@vmware.com> | 2018-04-08 11:17:58 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-08 11:25:09 +0800 |
commit | de625c16fa9e59e4e335364565e74a034b766ff9 (patch) | |
tree | 6738d62b487ec6ca261439409e7c0d1e09b18823 /vio | |
parent | 60eec67b9902bd8e96cdb3a9fc1c303c6da3dc66 (diff) |
Add list image test
Change-Id: I5ddffdc638be3eb3777a87ec19f5d35223a4cfd2
Issue-ID: MULTICLOUD-199
Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio/tests/test_fake_image_view.py | 14 |
1 files changed, 14 insertions, 0 deletions
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) |