Add support for Python 3
[yardstick.git] / tests / unit / benchmark / scenarios / dummy / test_dummy.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.benchmark.scenarios.dummy.dummy
13
14 from __future__ import absolute_import
15 import unittest
16
17 from yardstick.benchmark.scenarios.dummy import dummy
18
19
20 class DummyTestCase(unittest.TestCase):
21
22     def setUp(self):
23         self.test_context = dummy.Dummy(None, None)
24
25         self.assertIsNone(self.test_context.scenario_cfg)
26         self.assertIsNone(self.test_context.context_cfg)
27         self.assertEqual(self.test_context.setup_done, False)
28
29     def test_run(self):
30         result = {}
31         self.test_context.run(result)
32
33         self.assertEqual(result["hello"], "yardstick")
34         self.assertEqual(self.test_context.setup_done, True)