From 0d96b05b0a8d21ce90fc7a7e1768a87fa0e3260f Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 28 Feb 2018 15:22:15 +0100 Subject: Fully cover tier_builder.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I48ad1d430bb56b5be75b003800990a251f6a4065 Signed-off-by: Cédric Ollivier --- xtesting/tests/unit/ci/test_tier_builder.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'xtesting/tests') diff --git a/xtesting/tests/unit/ci/test_tier_builder.py b/xtesting/tests/unit/ci/test_tier_builder.py index 22a44a58..58a9d9d0 100644 --- a/xtesting/tests/unit/ci/test_tier_builder.py +++ b/xtesting/tests/unit/ci/test_tier_builder.py @@ -21,14 +21,19 @@ class TierBuilderTesting(unittest.TestCase): self.dependency = { 'installer': 'test_installer', 'scenario': 'test_scenario'} self.testcase = { - 'dependencies': self.dependency, 'enabled': 'true', + 'dependencies': self.dependency, 'enabled': True, 'case_name': 'test_name', 'criteria': 'test_criteria', 'blocking': 'test_blocking', 'description': 'test_desc', 'project_name': 'project_name'} + self.testcase_disabled = { + 'dependencies': self.dependency, 'enabled': False, + 'case_name': 'test_name_disabled', 'criteria': 'test_criteria', + 'blocking': 'test_blocking', 'description': 'test_desc', + 'project_name': 'project_name'} self.dic_tier = { 'name': 'test_tier', 'order': 'test_order', 'ci_loop': 'test_ci_loop', 'description': 'test_desc', - 'testcases': [self.testcase]} + 'testcases': [self.testcase, self.testcase_disabled]} self.mock_yaml = mock.Mock() attrs = {'get.return_value': [self.dic_tier]} self.mock_yaml.configure_mock(**attrs) @@ -60,6 +65,12 @@ class TierBuilderTesting(unittest.TestCase): self.assertEqual(self.tierbuilder.get_test('test_name'), self.tier_obj.get_test('test_name')) + def test_get_test_disabled(self): + self.assertEqual(self.tierbuilder.get_test('test_name_disabled'), None) + self.assertEqual(self.tier_obj.get_test('test_name_disabled'), None) + self.assertEqual( + self.tier_obj.get_skipped_test()[0].name, 'test_name_disabled') + def test_get_test_missing_test(self): self.assertEqual(self.tierbuilder.get_test('test_name2'), None) -- cgit 1.2.3-korg