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/utils/test_decorators.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'xtesting/tests/unit/utils') diff --git a/xtesting/tests/unit/utils/test_decorators.py b/xtesting/tests/unit/utils/test_decorators.py index 83b182a8..c08a7ea3 100644 --- a/xtesting/tests/unit/utils/test_decorators.py +++ b/xtesting/tests/unit/utils/test_decorators.py @@ -28,6 +28,13 @@ FILE = '{}/null'.format(DIR) URL = 'file://{}'.format(FILE) +class FakeTestCase(testcase.TestCase): + # pylint: disable=missing-docstring + + def run(self, **kwargs): + return testcase.TestCase.EX_OK + + class DecoratorsTesting(unittest.TestCase): # pylint: disable=missing-docstring @@ -66,7 +73,7 @@ class DecoratorsTesting(unittest.TestCase): return json.dumps(data, sort_keys=True) def _get_testcase(self): - test = testcase.TestCase( + test = FakeTestCase( project_name=self._project_name, case_name=self._case_name) test.start_time = self._start_time test.stop_time = self._stop_time @@ -74,6 +81,10 @@ class DecoratorsTesting(unittest.TestCase): test.details = {} return test + def test_run_fake(self): + test = self._get_testcase() + self.assertEqual(test.run(), testcase.TestCase.EX_OK) + @mock.patch('requests.post') def test_http_shema(self, *args): os.environ['TEST_DB_URL'] = 'http://127.0.0.1' -- cgit 1.2.3-korg