diff options
Diffstat (limited to 'xtesting/tests/unit/utils')
-rw-r--r-- | xtesting/tests/unit/utils/test_decorators.py | 13 |
1 files changed, 12 insertions, 1 deletions
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' |