Merge changes from topics 'YARDSTICK-1343', 'YARDSTICK-1342'
[yardstick.git] / yardstick / tests / unit / benchmark / core / test_testcase.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 import mock
11 from six.moves import builtins
12
13 from yardstick.benchmark.core import testcase
14 from yardstick.tests.unit import base as ut_base
15
16
17 class Arg(object):
18
19     def __init__(self):
20         self.casename = ('opnfv_yardstick_tc001', )
21
22
23 class TestcaseTestCase(ut_base.BaseUnitTestCase):
24
25     def test_list_all(self):
26         t = testcase.Testcase()
27         result = t.list_all("")
28         self.assertIsInstance(result, list)
29
30     @mock.patch.object(builtins, 'print')
31     def test_show(self, *args):
32         t = testcase.Testcase()
33         casename = Arg()
34         result = t.show(casename)
35         self.assertTrue(result)