diff options
author | xinhuili <lxinhui@vmware.com> | 2018-04-09 10:15:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-09 10:15:39 +0000 |
commit | 66f21f02c5342d0c0bdcd1659ae9ace96d2dde06 (patch) | |
tree | da62293625db5ac5a107a4adf6de034cf03aaa79 | |
parent | 123668fe5433af0093f2ccec2553a46087f79b35 (diff) | |
parent | 69987d22b987e344f6dedada64662766c13b236d (diff) |
Merge "Add fake get flavor detail test"
-rw-r--r-- | vio/vio/tests/test_fake_nova_view.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py index fc5b01f..eea01d0 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -104,3 +104,21 @@ class TestFakeNovaServerDetail(unittest.TestCase): } resp = self.view.get(req, "abcd") self.assertEqual(200, resp.status_code) + + +class TestFakeFlavorDetail(unittest.TestCase): + + def setUp(self): + self.view = views.FakeFlavorDetail() + + @mock.patch.object(fakeResponse, "get_flavors") + def test_get_server(self, mock_get_flavors): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + mock_get_flavors.return_value = { + "flavors": "1234abcd" + } + resp = self.view.get(req, "abcd", "1234") + self.assertEqual(200, resp.status_code) |