diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-07 05:52:55 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-07 11:43:29 +0200 |
commit | 7b64993e32b58364a6b59672d5a6dd4d2b5087e4 (patch) | |
tree | b661f1e425c217482a115f763642529de3305fd3 /functest/tests/unit/odl/test_odl.py | |
parent | c09efa8991bab081c53682cecfb2dce8fb5dc0a7 (diff) |
Update Xtesting to 0.34.0
It mainly fixes negative regex operations and allows calling one
skipped test via run_tests (parallel testing).
Change-Id: Ibf34ecf2dae46c4c3af15d05af2946c9eb33f6cd
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/odl/test_odl.py')
-rw-r--r-- | functest/tests/unit/odl/test_odl.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/functest/tests/unit/odl/test_odl.py b/functest/tests/unit/odl/test_odl.py index 0e11f796a..c1135632c 100644 --- a/functest/tests/unit/odl/test_odl.py +++ b/functest/tests/unit/odl/test_odl.py @@ -247,10 +247,34 @@ class ODLMainTesting(ODLTesting): @mock.patch('os.makedirs') @mock.patch('robot.run') @mock.patch('os.path.isfile', return_value=True) + def test_generate_report_ko(self, *args): + with mock.patch.object(self.test, 'set_robotframework_vars', + return_value=True), \ + mock.patch.object(self.test, 'parse_results'), \ + mock.patch.object(self.test, 'generate_report', + return_value=1): + self._test_run_suites(testcase.TestCase.EX_RUN_ERROR, *args) + + @mock.patch('os.makedirs') + @mock.patch('robot.run') + @mock.patch('os.path.isfile', return_value=True) + def test_generate_report_exc(self, *args): + with mock.patch.object(self.test, 'set_robotframework_vars', + return_value=True), \ + mock.patch.object(self.test, 'parse_results'), \ + mock.patch.object(self.test, 'generate_report', + side_effect=Exception): + self._test_run_suites(testcase.TestCase.EX_RUN_ERROR, *args) + + @mock.patch('os.makedirs') + @mock.patch('robot.run') + @mock.patch('os.path.isfile', return_value=True) def test_ok(self, *args): with mock.patch.object(self.test, 'set_robotframework_vars', return_value=True), \ - mock.patch.object(self.test, 'parse_results'): + mock.patch.object(self.test, 'parse_results'), \ + mock.patch.object(self.test, 'generate_report', + return_value=0): self._test_run_suites(testcase.TestCase.EX_OK, *args) @mock.patch('os.makedirs') @@ -259,7 +283,9 @@ class ODLMainTesting(ODLTesting): def test_ok_no_creds(self, *args): with mock.patch.object(self.test, 'set_robotframework_vars', return_value=True) as mock_method, \ - mock.patch.object(self.test, 'parse_results'): + mock.patch.object(self.test, 'parse_results'), \ + mock.patch.object(self.test, 'generate_report', + return_value=0): self._test_run_suites(testcase.TestCase.EX_OK, *args) mock_method.assert_not_called() @@ -269,7 +295,9 @@ class ODLMainTesting(ODLTesting): def test_testcases_in_failure(self, *args): with mock.patch.object(self.test, 'set_robotframework_vars', return_value=True), \ - mock.patch.object(self.test, 'parse_results'): + mock.patch.object(self.test, 'parse_results'), \ + mock.patch.object(self.test, 'generate_report', + return_value=0): self._test_run_suites(testcase.TestCase.EX_OK, *args) |