summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorBin Sun <bins@vmware.com>2018-04-10 10:54:00 +0800
committerBin Sun <bins@vmware.com>2018-04-10 11:09:44 +0800
commit936214eebad3047e51a76f9b1c183be3199d4cee (patch)
treebf68657986ff8a7ac06939f83e0eb1614ce86ecb /vio
parentad9741ac91f8b6be6aaa87fd4c214e44ceaf172a (diff)
Add get fake network detail test
Change-Id: Ifa3a9faf956b788f92aa352952d4a2783c9cdb07 Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_fake_neutron_view.py20
1 files changed, 19 insertions, 1 deletions
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)