summaryrefslogtreecommitdiffstats
path: root/tests/unit/cmd/commands/test_task.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/cmd/commands/test_task.py')
-rw-r--r--tests/unit/cmd/commands/test_task.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/cmd/commands/test_task.py b/tests/unit/cmd/commands/test_task.py
index e785e99a9..5b404c48d 100644
--- a/tests/unit/cmd/commands/test_task.py
+++ b/tests/unit/cmd/commands/test_task.py
@@ -56,3 +56,17 @@ class TaskCommandsTestCase(unittest.TestCase):
mock_base_runner.Runner.get.return_value = runner
t._run([scenario], False, "yardstick.out")
self.assertTrue(runner.run.called)
+
+ @mock.patch('yardstick.cmd.commands.task.os')
+ def test_check_precondition(self, mock_os):
+ cfg = \
+ {'precondition':
+ {'installer_type': 'compass',
+ 'deploy_scenarios': 'os-nosdn'
+ }
+ }
+
+ t = task.TaskParser('/opt')
+ mock_os.environ.get.side_effect = ['compass', 'os-nosdn']
+ result = t._check_precondition(cfg)
+ self.assertTrue(result)