Merge "Record test case names when run a task using API"
[yardstick.git] / tests / unit / benchmark / core / test_testcase.py
1 #!/usr/bin/env python
2
3 ##############################################################################
4 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # Unittest for yardstick.cmd.commands.testcase
13
14 import unittest
15
16 from yardstick.benchmark.core import testcase
17
18
19 class Arg(object):
20     def __init__(self):
21         self.casename = ('opnfv_yardstick_tc001',)
22
23
24 class TestcaseUT(unittest.TestCase):
25
26     def test_list_all(self):
27         t = testcase.Testcase()
28         result = t.list_all("")
29         self.assertEqual(result, True)
30
31     def test_show(self):
32         t = testcase.Testcase()
33         casename = Arg()
34         result = t.show(casename)
35         self.assertEqual(result, True)
36
37
38 def main():
39     unittest.main()
40
41
42 if __name__ == '__main__':
43     main()