diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-28 15:22:15 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-28 15:23:07 +0100 |
commit | 0d96b05b0a8d21ce90fc7a7e1768a87fa0e3260f (patch) | |
tree | 32888b5e4ec425b7ce5b00154f02d9fa35929934 /xtesting/tests/unit/ci/test_tier_builder.py | |
parent | d30a79ce464a596a29cb1385b88dd00ac42a2c61 (diff) |
Fully cover tier_builder.py
Change-Id: I48ad1d430bb56b5be75b003800990a251f6a4065
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/tests/unit/ci/test_tier_builder.py')
-rw-r--r-- | xtesting/tests/unit/ci/test_tier_builder.py | 15 |
1 files changed, 13 insertions, 2 deletions
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) |