summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/network_services/libs/ixia_libs/test_IxNet.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py b/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
index 87d76f829..ae4c58de1 100644
--- a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
+++ b/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
@@ -32,19 +32,14 @@ class TestIxNextgen(unittest.TestCase):
ixnet_gen = IxNextgen()
self.assertIsNone(ixnet_gen._bidir)
- @mock.patch("yardstick.network_services.libs.ixia_libs.IxNet.IxNet.IxNetwork")
@mock.patch("yardstick.network_services.libs.ixia_libs.IxNet.IxNet.sys")
- def test_connect(self, mock_sys, mock_ix_network):
- mock_ix_network.IxNet.return_value = mock_ixnet = mock.Mock()
+ def test_connect(self, mock_sys):
ixnet_gen = IxNextgen()
ixnet_gen.get_config = mock.MagicMock()
ixnet_gen.get_ixnet = mock.MagicMock()
- result = ixnet_gen._connect({"py_lib_path": "/tmp"})
- self.assertIsNotNone(result)
- self.assertEqual(mock_ix_network.IxNet.call_count, 1)
- self.assertEqual(mock_ixnet.connect.call_count, 1)
+ self.assertRaises(ImportError, ixnet_gen._connect, {"py_lib_path": "/tmp"})
def test_clear_ixia_config(self):
ixnet = mock.MagicMock()
@@ -455,7 +450,7 @@ class TestIxNextgen(unittest.TestCase):
}
ixnet = mock.MagicMock()
- ixnet.remapIds.return_value=["0"]
+ ixnet.remapIds.return_value = ["0"]
ixnet.setMultiAttribute.return_value = [1]
ixnet.commit.return_value = [1]
ixnet.getList.side_effect = [[1], [0, 1], [0], ["srcIp", "dstIp"]]
@@ -865,7 +860,7 @@ class TestIxNextgen(unittest.TestCase):
ixnet = mock.MagicMock()
ixnet.setMultiAttribute.return_value = [1]
ixnet.commit.return_value = [1]
- ixnet.getList.side_effect=[
+ ixnet.getList.side_effect = [
[1],
[1],
[1],