diff options
author | Bin Sun <bins@vmware.com> | 2018-04-09 10:06:17 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-09 10:06:53 +0800 |
commit | e952112fec17050820346cb8413f36db04f63dfb (patch) | |
tree | f2448b5a893ae928424f395ddcb83f3f9affafb7 /vio | |
parent | 0da31c84e1780e040fe46517c008d73a082b29d9 (diff) |
Add get fake aggregate test
Change-Id: Ie7bd93109fc92c9d9568c09fa4ec1a389d03bf0f
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 e01e26e..cb63e56 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -68,3 +68,21 @@ class TestFakeNovaHypervisors(unittest.TestCase): } resp = self.view.get(req, "abcd") self.assertEqual(200, resp.status_code) + + +class TestFakeNovaAggregate(unittest.TestCase): + + def setUp(self): + self.view = views.FakeNovaAggregate() + + @mock.patch.object(fakeResponse, "get_osaggregates") + def test_get_server(self, mock_get_osaggregates): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + mock_get_osaggregates.return_value = { + "osaggregates": "1234abcd" + } + resp = self.view.get(req, "abcd") + self.assertEqual(200, resp.status_code) |