From f35a89304ffee58a46a932ee9df710523a876d18 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Thu, 11 Apr 2019 14:06:08 +0800 Subject: Add UT for add_servers function Add unit test for add_vservers function Change-Id: I93c3042b78abc2464cf2b9553982f9ca8ac4e82c Issue-ID: MULTICLOUD-507 Signed-off-by: Ethan Lynn --- vio/vio/tests/test_aai_client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vio/vio/tests/test_aai_client.py b/vio/vio/tests/test_aai_client.py index ad66f40..1875d4c 100644 --- a/vio/vio/tests/test_aai_client.py +++ b/vio/vio/tests/test_aai_client.py @@ -95,6 +95,19 @@ class TestAAIClient(unittest.TestCase): self.view.add_images(images) mock_call.assert_called_once() + @mock.patch.object(restcall, "call_req") + def test_add_servers(self, mock_call): + servers = { + "servers": [{ + "name": "server-name", + "id": "server-id", + "link": "/instances/server-id", + "status": "ACTIVE", + }] + } + self.view.add_vservers(servers) + mock_call.assert_called_once() + @mock.patch.object(restcall, "call_req") def test_add_networks(self, mock_call): networks = { -- cgit 1.2.3-korg