From 5afc689af525edfad41d258fe572ca3bc3e45550 Mon Sep 17 00:00:00 2001 From: Bin Sun Date: Sun, 8 Apr 2018 14:03:14 +0800 Subject: Add image version test Change-Id: I7950e7e4bb051b0da8ef762d08ed96916ed70078 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 1de6fa3..d215156 100644 --- a/vio/vio/tests/test_fake_image_view.py +++ b/vio/vio/tests/test_fake_image_view.py @@ -57,3 +57,17 @@ class TestFakeImageSchema(unittest.TestCase): } resp = self.view.get(mock.Mock()) self.assertEqual(200, resp.status_code) + + +class TestFakeImageVersion(unittest.TestCase): + + def setUp(self): + self.view = views.FakeImageVersion() + + @mock.patch.object(fakeResponse, "image_version") + def test_get(self, mock_image_version): + mock_image_version.return_value = { + "versions": [{"id": "v1.0"}] + } + resp = self.view.get(mock.Mock()) + self.assertEqual(200, resp.status_code) -- cgit 1.2.3-korg