aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-04-27 10:29:27 +0000
committerEmma Foley <emma.l.foley@intel.com>2018-06-20 09:52:16 +0000
commitc87a5438961cba359629800b31df3ad7f656aff8 (patch)
treef0e2ea7ac2aef3cd41e324f15c758dce0d69525d
parent7411096e94f7e30f03c73cc0b8d66dbd076fc37e (diff)
Move tests: unit/network_services/{lib/,collector/,*.py}
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. JIRA: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: Idc2e70291b6d9b4cf7e7249a10c4a290b999206c (cherry picked from commit 2e75e6d27240945ec985998bbe9ec6241d11626a)
-rw-r--r--yardstick/tests/unit/network_services/__init__.py (renamed from tests/unit/network_services/collector/__init__.py)0
-rw-r--r--yardstick/tests/unit/network_services/collector/__init__.py (renamed from tests/unit/network_services/libs/__init__.py)0
-rw-r--r--yardstick/tests/unit/network_services/collector/test_publisher.py (renamed from tests/unit/network_services/collector/test_publisher.py)3
-rw-r--r--yardstick/tests/unit/network_services/collector/test_subscriber.py (renamed from tests/unit/network_services/collector/test_subscriber.py)3
-rw-r--r--yardstick/tests/unit/network_services/libs/__init__.py (renamed from tests/unit/network_services/libs/ixia_libs/__init__.py)0
-rw-r--r--yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py0
-rw-r--r--yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py (renamed from tests/unit/network_services/libs/ixia_libs/test_IxNet.py)14
-rw-r--r--yardstick/tests/unit/network_services/test_utils.py (renamed from tests/unit/network_services/test_utils.py)2
-rw-r--r--yardstick/tests/unit/network_services/test_yang_model.py (renamed from tests/unit/network_services/test_yang_model.py)12
9 files changed, 8 insertions, 26 deletions
diff --git a/tests/unit/network_services/collector/__init__.py b/yardstick/tests/unit/network_services/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/network_services/collector/__init__.py
+++ b/yardstick/tests/unit/network_services/__init__.py
diff --git a/tests/unit/network_services/libs/__init__.py b/yardstick/tests/unit/network_services/collector/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/network_services/libs/__init__.py
+++ b/yardstick/tests/unit/network_services/collector/__init__.py
diff --git a/tests/unit/network_services/collector/test_publisher.py b/yardstick/tests/unit/network_services/collector/test_publisher.py
index 4a175841d..145441ddd 100644
--- a/tests/unit/network_services/collector/test_publisher.py
+++ b/yardstick/tests/unit/network_services/collector/test_publisher.py
@@ -13,9 +13,6 @@
# limitations under the License.
#
-# Unittest for yardstick.network_services.collector.publisher
-
-from __future__ import absolute_import
import unittest
from yardstick.network_services.collector import publisher
diff --git a/tests/unit/network_services/collector/test_subscriber.py b/yardstick/tests/unit/network_services/collector/test_subscriber.py
index d4b4ecf7a..9b9649979 100644
--- a/tests/unit/network_services/collector/test_subscriber.py
+++ b/yardstick/tests/unit/network_services/collector/test_subscriber.py
@@ -13,9 +13,6 @@
# limitations under the License.
#
-# Unittest for yardstick.network_services.collector.subscriber
-
-from __future__ import absolute_import
import unittest
import mock
diff --git a/tests/unit/network_services/libs/ixia_libs/__init__.py b/yardstick/tests/unit/network_services/libs/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/network_services/libs/ixia_libs/__init__.py
+++ b/yardstick/tests/unit/network_services/libs/__init__.py
diff --git a/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py b/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/yardstick/tests/unit/network_services/libs/ixia_libs/__init__.py
diff --git a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py b/yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
index 2a97048aa..fe750e5ba 100644
--- a/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
+++ b/yardstick/tests/unit/network_services/libs/ixia_libs/test_IxNet.py
@@ -13,9 +13,6 @@
# limitations under the License.
#
-# Unittest for yardstick.network_services.libs.ixia_libs.IxNet
-
-from __future__ import absolute_import
import unittest
import mock
@@ -23,10 +20,10 @@ from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IxNextgen
from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IP_VERSION_4
from yardstick.network_services.libs.ixia_libs.IxNet.IxNet import IP_VERSION_6
-
UPLINK = "uplink"
DOWNLINK = "downlink"
+
class TestIxNextgen(unittest.TestCase):
def test___init__(self):
@@ -40,7 +37,8 @@ class TestIxNextgen(unittest.TestCase):
ixnet_gen.get_config = mock.MagicMock()
ixnet_gen.get_ixnet = mock.MagicMock()
- self.assertRaises(ImportError, ixnet_gen._connect, {"py_lib_path": "/tmp"})
+ self.assertRaises(ImportError, ixnet_gen._connect,
+ {"py_lib_path": "/tmp"})
def test_clear_ixia_config(self):
ixnet = mock.MagicMock()
@@ -628,11 +626,9 @@ class TestIxNextgen(unittest.TestCase):
def test_set_random_ip_multi_attributes_bad_ip_version(self):
bad_ip_version = object()
ixnet_gen = IxNextgen(mock.Mock())
- mock1 = mock.Mock()
- mock2 = mock.Mock()
- mock3 = mock.Mock()
with self.assertRaises(ValueError):
- ixnet_gen.set_random_ip_multi_attributes(mock1, bad_ip_version, mock2, mock3)
+ ixnet_gen.set_random_ip_multi_attributes(
+ mock.Mock(), bad_ip_version, mock.Mock(), mock.Mock())
def test_get_config(self):
tg_cfg = {
diff --git a/tests/unit/network_services/test_utils.py b/yardstick/tests/unit/network_services/test_utils.py
index bf98a4474..2b2eb7109 100644
--- a/tests/unit/network_services/test_utils.py
+++ b/yardstick/tests/unit/network_services/test_utils.py
@@ -13,8 +13,6 @@
# limitations under the License.
#
-# Unittest for yardstick.network_services.utils
-
import os
import unittest
import mock
diff --git a/tests/unit/network_services/test_yang_model.py b/yardstick/tests/unit/network_services/test_yang_model.py
index 0b29da701..a7eb36b8a 100644
--- a/tests/unit/network_services/test_yang_model.py
+++ b/yardstick/tests/unit/network_services/test_yang_model.py
@@ -13,14 +13,8 @@
# limitations under the License.
#
-# Unittest for yardstick.network_services.utils
-
-from __future__ import absolute_import
-
-import unittest
import mock
-
-import yaml
+import unittest
from yardstick.network_services.yang_model import YangModel
@@ -95,9 +89,9 @@ class YangModelTestCase(unittest.TestCase):
y._get_entries()
self.assertEqual(y._rules, '')
- @mock.patch('yardstick.network_services.yang_model.yaml_load')
@mock.patch('yardstick.network_services.yang_model.open')
- def test__read_config(self, mock_open, mock_safe_load):
+ @mock.patch('yardstick.network_services.yang_model.yaml_load')
+ def test__read_config(self, mock_safe_load, *args):
cfg = "yang.yaml"
y = YangModel(cfg)
mock_safe_load.return_value = expected = {'key1': 'value1', 'key2': 'value2'}