Add functional tests in verify and merge
[yardstick.git] / tests / functional / test_cli_runner.py
1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10
11 import unittest
12
13 from tests.functional import utils
14
15
16 class RunnerTestCase(unittest.TestCase):
17
18     def setUp(self):
19         super(RunnerTestCase, self).setUp()
20         self.yardstick = utils.Yardstick()
21
22     def test_runner_list(self):
23         res = self.yardstick("runner list")
24
25         self.assertIn("Duration", res)
26         self.assertIn("Arithmetic", res)
27         self.assertIn("Iteration", res)
28         self.assertIn("Sequence", res)
29
30     def test_runner_show_Duration(self):
31         res = self.yardstick("runner show Duration")
32         duration = "duration - amount of time" in res
33         self.assertTrue(duration)
34
35     def test_runner_show_Arithmetic(self):
36         res = self.yardstick("runner show Arithmetic")
37         arithmetic = "Run a scenario arithmetically" in res
38         self.assertTrue(arithmetic)
39
40     def test_runner_show_Iteration(self):
41         res = self.yardstick("runner show Iteration")
42         iteration = "iterations - amount of times" in res
43         self.assertTrue(iteration)
44
45     def test_runner_show_Sequence(self):
46         res = self.yardstick("runner show Sequence")
47         sequence = "sequence - list of values which are executed" in res
48         self.assertTrue(sequence)
49