From 936214eebad3047e51a76f9b1c183be3199d4cee Mon Sep 17 00:00:00 2001 From: Bin Sun Date: Tue, 10 Apr 2018 10:54:00 +0800 Subject: Add get fake network detail test Change-Id: Ifa3a9faf956b788f92aa352952d4a2783c9cdb07 Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun --- vio/vio/tests/test_fake_neutron_view.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/vio/vio/tests/test_fake_neutron_view.py b/vio/vio/tests/test_fake_neutron_view.py index 4a9c061..6c62b0b 100644 --- a/vio/vio/tests/test_fake_neutron_view.py +++ b/vio/vio/tests/test_fake_neutron_view.py @@ -40,7 +40,7 @@ class TestakeNeutron(unittest.TestCase): self.assertEqual(200, resp.status_code) -class TesFakeNeutronNetwork(unittest.TestCase): +class TestFakeNeutronNetwork(unittest.TestCase): def setUp(self): self.view = views.FakeNeutronNetwork() @@ -56,3 +56,21 @@ class TesFakeNeutronNetwork(unittest.TestCase): } resp = self.view.get(req) self.assertEqual(200, resp.status_code) + + +class TestFakeNeutronDetail(unittest.TestCase): + + def setUp(self): + self.view = views.FakeNeutronDetail() + + @mock.patch.object(fakeResponse, "neutron_detail") + def test_get_neutron_detail(self, mock_neutron_detail): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + mock_neutron_detail.return_value = { + "network": "net1" + } + resp = self.view.get(req, "1234abcd") + self.assertEqual(200, resp.status_code) -- cgit 1.2.3-korg