aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-14 09:54:51 -0700
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2017-12-21 14:12:58 +0000
commit986ae407906b479dd8530df798a6caca8b1b8cc4 (patch)
treeb8849ece79b068bc9f7fd4b507eb5c801c2e3168 /tests/unit
parente268fa7ae7c17604ecad787d6940fdf77426dc0f (diff)
Rename test/unit/cmd directory
Renamed test/unit/cmd directory to test/unit/test_cmd, in order to avoid importing errors during the execution of unit tests. This directory name collides with Python "cmd" library. Change-Id: Ie06d58d4faace33df684c8e511a398aa0667b098 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_cmd/__init__.py (renamed from tests/unit/cmd/__init__.py)0
-rw-r--r--tests/unit/test_cmd/commands/__init__.py (renamed from tests/unit/cmd/commands/__init__.py)0
-rw-r--r--tests/unit/test_cmd/commands/test_env.py (renamed from tests/unit/cmd/commands/test_env.py)6
-rw-r--r--tests/unit/test_cmd/commands/test_testcase.py (renamed from tests/unit/cmd/commands/test_testcase.py)0
-rw-r--r--tests/unit/test_cmd/test_NSBperf.py (renamed from tests/unit/cmd/test_NSBperf.py)3
5 files changed, 7 insertions, 2 deletions
diff --git a/tests/unit/cmd/__init__.py b/tests/unit/test_cmd/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/cmd/__init__.py
+++ b/tests/unit/test_cmd/__init__.py
diff --git a/tests/unit/cmd/commands/__init__.py b/tests/unit/test_cmd/commands/__init__.py
index e69de29bb..e69de29bb 100644
--- a/tests/unit/cmd/commands/__init__.py
+++ b/tests/unit/test_cmd/commands/__init__.py
diff --git a/tests/unit/cmd/commands/test_env.py b/tests/unit/test_cmd/commands/test_env.py
index 73cd5af47..13c3ed44a 100644
--- a/tests/unit/cmd/commands/test_env.py
+++ b/tests/unit/test_cmd/commands/test_env.py
@@ -49,6 +49,9 @@ class EnvCommandTestCase(unittest.TestCase):
@mock.patch('yardstick.cmd.commands.env.HttpClient.get')
@mock.patch('yardstick.cmd.commands.env.EnvCommand._print_status')
def test_check_status(self, print_mock, get_mock):
+ # pylint: disable=unused-argument
+ # NOTE(ralonsoh): the pylint exception must be removed. The mocked
+ # command call must be tested.
task_id = str(uuid.uuid4())
get_mock.return_value = {'status': 2, 'result': 'error'}
status = EnvCommand()._check_status(task_id, 'hello world')
@@ -57,7 +60,8 @@ class EnvCommandTestCase(unittest.TestCase):
def test_print_status(self):
try:
EnvCommand()._print_status('hello', 'word')
- except Exception as e:
+ except Exception as e: # pylint: disable=broad-except
+ # NOTE(ralonsoh): try to reduce the scope of this exception.
self.assertIsInstance(e, IndexError)
diff --git a/tests/unit/cmd/commands/test_testcase.py b/tests/unit/test_cmd/commands/test_testcase.py
index 7ef157c19..7ef157c19 100644
--- a/tests/unit/cmd/commands/test_testcase.py
+++ b/tests/unit/test_cmd/commands/test_testcase.py
diff --git a/tests/unit/cmd/test_NSBperf.py b/tests/unit/test_cmd/test_NSBperf.py
index e1b4da7fc..19eb0afa0 100644
--- a/tests/unit/cmd/test_NSBperf.py
+++ b/tests/unit/test_cmd/test_NSBperf.py
@@ -27,7 +27,8 @@ from yardstick.cmd import NSBperf
@mock.patch('six.moves.input', return_value='0')
class TestHandler(unittest.TestCase):
- def test_handler(self, test):
+
+ def test_handler(self, *args):
subprocess.call = mock.Mock(return_value=0)
self.assertRaises(SystemExit, NSBperf.sigint_handler)