Skip to content

Commit 9066f68

Browse files
committed
fix vip_request tests
1 parent 49e1007 commit 9066f68

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

networkapi/api_vip_request/tests/sanity/sync/test_post.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ def setUp(self):
4444
def tearDown(self):
4545
pass
4646

47+
@patch('networkapi.plugins.factory.PluginFactory.factory')
4748
@patch('networkapi.api_vip_request.syncs.new_to_old')
48-
def test_post_two_vips_success(self, mock_new_to_old):
49+
def test_post_two_vips_success(self, mock_new_to_old, mock_plugin_factory):
4950
"""Test of success to post one vip."""
51+
mock_plugin_factory.return_value.get_name_eqpt.return_value = 'VIP1_test_80'
5052

5153
name_file = 'api_vip_request/tests/sanity/json/post/test_vip_request_post_2_ports.json'
5254

networkapi/api_vip_request/tests/sanity/sync/test_put.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ def setUp(self):
4545
def tearDown(self):
4646
pass
4747

48+
@patch('networkapi.plugins.factory.PluginFactory.factory')
4849
@patch('networkapi.api_vip_request.syncs.new_to_old')
49-
def test_put_two_vips_success(self, mock_new_to_old):
50+
def test_put_two_vips_success(self, mock_new_to_old, mock_plugin_factory):
5051
"""Test of success to put two vips."""
52+
mock_plugin_factory.return_value.get_name_eqpt.return_value = 'VIP1_test_80'
5153

5254
name_file = 'api_vip_request/tests/sanity/json/put/test_vip_request_put_two.json'
5355

0 commit comments

Comments
 (0)