summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-08-16 21:20:55 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-08-17 09:56:56 -0700
commit126450b753244c089dbae8f3f10a4a141d65cf57 (patch)
treef4e6ba32c0e0c8f64c66bcaf3fde2092b724d213 /tests/unit
parente07484ef707af89c12ebf3e9ed4490d9ff588750 (diff)
Fix import error in IxNetwork
This patch fixes import error related to ixnetwork and do not wait for TG server to start as IXIA is always running :) Change-Id: I49d6b100eadafad75431cb8974605a6faa496f23 Signed-off-by: Deepak S <deepak.s@linux.intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit')
-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],