From 82d481e8f149e9b78b3176a37b9885657ef245b4 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Tue, 27 Mar 2018 11:36:34 -0700 Subject: Add test_get for IdentityVersionLink Add test_get Change-Id: I346a9f10bb2b51ab8aefb522828bf4c05abfb10f Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn --- vio/vio/tests/test_proxy_identity_view.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'vio') diff --git a/vio/vio/tests/test_proxy_identity_view.py b/vio/vio/tests/test_proxy_identity_view.py index 729fba0..a8bf9fb 100644 --- a/vio/vio/tests/test_proxy_identity_view.py +++ b/vio/vio/tests/test_proxy_identity_view.py @@ -239,3 +239,26 @@ class TestTokenV2View(unittest.TestCase): mock_post.return_value = res resp = self.view.post(req, "vmware_nova") self.assertEqual(200, resp.status_code) + + +class TestIdentityVersionLink(unittest.TestCase): + + def setUp(self): + self.view = views.IdentityVersionLink() + + @mock.patch.object(BaseClient, "buildRequest") + @mock.patch.object(BaseClient, "_request") + def test_get(self, mock_req, mock_build): + mock_build.return_value = ("http://onap.org", {}, None) + res = mock.Mock() + res.status_code = 200 + res.data = { + "version": { + "links": [{ + "href": "" + }] + } + } + mock_req.return_value = res + resp = self.view.get(mock.Mock(), "vmware_nova") + self.assertEqual(200, resp.status_code) -- cgit 1.2.3-korg