aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2017-11-29 22:56:21 +0000
committerEmma Foley <emma.l.foley@intel.com>2018-02-12 16:57:56 +0000
commitba4e9e6e47bd10ecc803bab920178ea973c2fa86 (patch)
tree54576c199cabe8ccc29d04eedfe0e4f88b2bd598 /tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py
parentbabe3cc2882e19c6dafdbf41d502d7ba5560635a (diff)
Move tests: unit/benchmark
* Fix pylint errors * Add TODOs Some errors are ignored locally, as they were a symptom of other problems. These issues have been flagged with a TODO, and should be fixed later. Change-Id: I30eb4b0aafe0575d0cddbc946108291f21a98ed8 Jira: YARDSTICK-837 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py')
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py93
1 files changed, 0 insertions, 93 deletions
diff --git a/tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py b/tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py
deleted file mode 100644
index 36ce900fb..000000000
--- a/tests/unit/benchmark/scenarios/availability/test_baseresultchecker.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-# Copyright (c) 2016 Huan Li and others
-# lihuansse@tongji.edu.cn
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-# Unittest for yardstick.benchmark.scenarios.availability.result_checker
-# .baseresultchecker
-
-from __future__ import absolute_import
-import mock
-import unittest
-
-from yardstick.benchmark.scenarios.availability.result_checker import \
- baseresultchecker
-
-
-@mock.patch('yardstick.benchmark.scenarios.availability.result_checker'
- '.baseresultchecker.BaseResultChecker')
-class ResultCheckerMgrTestCase(unittest.TestCase):
-
- def setUp(self):
- config = {
- 'checker_type': 'general-result-checker',
- 'key': 'process-checker'
- }
-
- self.checker_configs = []
- self.checker_configs.append(config)
-
- def test_ResultCheckerMgr_setup_successful(self, mock_basechacer):
- mgr_ins = baseresultchecker.ResultCheckerMgr()
- mgr_ins.init_ResultChecker(self.checker_configs, None)
- mgr_ins.verify()
-
- def test_getitem_succeessful(self, mock_basechacer):
- mgr_ins = baseresultchecker.ResultCheckerMgr()
- mgr_ins.init_ResultChecker(self.checker_configs, None)
- checker_ins = mgr_ins["process-checker"]
-
- def test_getitem_fail(self, mock_basechacer):
- mgr_ins = baseresultchecker.ResultCheckerMgr()
- mgr_ins.init_ResultChecker(self.checker_configs, None)
- with self.assertRaises(KeyError):
- checker_ins = mgr_ins["checker-not-exist"]
-
-
-class BaseResultCheckerTestCase(unittest.TestCase):
-
- class ResultCheckeSimple(baseresultchecker.BaseResultChecker):
- __result_checker__type__ = "ResultCheckeForTest"
-
- def setup(self):
- self.success = False
-
- def verify(self):
- return self.success
-
- def setUp(self):
- self.checker_cfg = {
- 'checker_type': 'general-result-checker',
- 'key': 'process-checker'
- }
-
- def test_baseresultchecker_setup_verify_successful(self):
- ins = baseresultchecker.BaseResultChecker(self.checker_cfg, None)
- ins.setup()
- ins.verify()
-
- def test_baseresultchecker_verfiy_pass(self):
- ins = baseresultchecker.BaseResultChecker(self.checker_cfg, None)
- ins.setup()
- ins.actualResult = True
- ins.expectedResult = True
- ins.verify()
-
- def test_get_script_fullpath(self):
- ins = baseresultchecker.BaseResultChecker(self.checker_cfg, None)
- path = ins.get_script_fullpath("test.bash")
-
- def test_get_resultchecker_cls_successful(self):
- baseresultchecker.BaseResultChecker.get_resultchecker_cls(
- "ResultCheckeForTest")
-
- def test_get_resultchecker_cls_fail(self):
- with self.assertRaises(RuntimeError):
- baseresultchecker.BaseResultChecker.get_resultchecker_cls(
- "ResultCheckeNotExist")