1 ##############################################################################
2 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
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 ##############################################################################
11 from yardstick.benchmark.scenarios.lib.check_value import CheckValue
14 class CheckValueTestCase(unittest.TestCase):
16 def test_check_value_eq(self):
17 scenario_cfg = {'options': {'operator': 'eq', 'value1': 1, 'value2': 2}}
18 obj = CheckValue(scenario_cfg, {})
21 except Exception as e:
22 self.assertIsInstance(e, AssertionError)
24 def test_check_value_eq_pass(self):
25 scenario_cfg = {'options': {'operator': 'eq', 'value1': 1, 'value2': 1}}
26 obj = CheckValue(scenario_cfg, {})
29 except Exception as e:
30 self.assertIsInstance(e, AssertionError)
32 def test_check_value_ne(self):
33 scenario_cfg = {'options': {'operator': 'ne', 'value1': 1, 'value2': 1}}
34 obj = CheckValue(scenario_cfg, {})
37 except Exception as e:
38 self.assertIsInstance(e, AssertionError)
45 if __name__ == '__main__':