diff options
author | Bin Sun <bins@vmware.com> | 2018-04-09 10:24:26 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-09 10:24:49 +0800 |
commit | 69987d22b987e344f6dedada64662766c13b236d (patch) | |
tree | 37303987596ebaae5b2267ec92c17bb08f9339d0 /vio | |
parent | 5f4eafec37170f835fbe5c3124197f8eb6cae724 (diff) |
Add fake get flavor detail test
Change-Id: I8aecb0d9a67279060b8a02c5209a621a3cda7ada
Issue-ID: MULTICLOUD-199
Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-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) |