diff options
author | Bin Sun <bins@vmware.com> | 2018-04-10 10:46:42 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-10 10:47:11 +0800 |
commit | ad9741ac91f8b6be6aaa87fd4c214e44ceaf172a (patch) | |
tree | 897c42e30a4b534362625e7bd9958df64424647b /vio | |
parent | f202ded7060f624d666e297fe6ba998f54b1b895 (diff) |
Add fake get network test
Change-Id: I54e474be17b14fe2bd184eb6ef8528f9a67b3661
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.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_neutron_view.py b/vio/vio/tests/test_fake_neutron_view.py index 9e670d7..4a9c061 100644 --- a/vio/vio/tests/test_fake_neutron_view.py +++ b/vio/vio/tests/test_fake_neutron_view.py @@ -38,3 +38,21 @@ class TestakeNeutron(unittest.TestCase): } resp = self.view.get(req) self.assertEqual(200, resp.status_code) + + +class TesFakeNeutronNetwork(unittest.TestCase): + + def setUp(self): + self.view = views.FakeNeutronNetwork() + + @mock.patch.object(fakeResponse, "network_list") + def test_get_neutron_network(self, mock_network_list): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + mock_network_list.return_value = { + "network": "net1" + } + resp = self.view.get(req) + self.assertEqual(200, resp.status_code) |