From 95092b511dbacac412dbe5b8ff3a28abb3d3f664 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 10 Aug 2018 12:55:10 +0200 Subject: Leverage on abc and stevedore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7b3c4c0c5dd0c9e6fb3e52c3fff5221d4b831b02 Signed-off-by: Cédric Ollivier --- xtesting/tests/unit/core/test_feature.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'xtesting/tests/unit/core/test_feature.py') diff --git a/xtesting/tests/unit/core/test_feature.py b/xtesting/tests/unit/core/test_feature.py index 72bc488f..a4ac5af7 100644 --- a/xtesting/tests/unit/core/test_feature.py +++ b/xtesting/tests/unit/core/test_feature.py @@ -18,6 +18,19 @@ from xtesting.core import feature from xtesting.core import testcase +class FakeTestCase(feature.Feature): + + def execute(self, **kwargs): + pass + + +class AbstractFeatureTesting(unittest.TestCase): + + def test_run_unimplemented(self): + with self.assertRaises(TypeError): + feature.Feature(case_name="feature", project_name="xtesting") + + class FeatureTestingBase(unittest.TestCase): _case_name = "foo" @@ -46,7 +59,7 @@ class FeatureTesting(FeatureTestingBase): # what will break these unit tests. logging.disable(logging.CRITICAL) with mock.patch('six.moves.builtins.open'): - self.feature = feature.Feature( + self.feature = FakeTestCase( project_name=self._project_name, case_name=self._case_name) def test_run_exc(self): -- cgit 1.2.3-korg