aboutsummaryrefslogtreecommitdiffstats
path: root/xtesting/tests/unit/core/test_robotframework.py
diff options
context:
space:
mode:
authorDeepak Chandella <deepak.chandella@orange.com>2019-07-05 22:31:36 +0530
committerCédric Ollivier <cedric.ollivier@orange.com>2019-07-11 11:35:54 +0200
commit5dd0d0ffd46e7665fddde8fd2f4da1a9b58506bb (patch)
tree9be57539cde78b3c82dd2442dfb108827d66ca69 /xtesting/tests/unit/core/test_robotframework.py
parent2d35738769a5118fdcf7a7092e4fd0fb7f15511d (diff)
Adding first patch for behave feature
Change-Id: Ic975c301103b49cdec2bd26746b708388f21e892 Signed-off-by: Deepak Chandella <deepak.chandella@orange.com>
Diffstat (limited to 'xtesting/tests/unit/core/test_robotframework.py')
-rw-r--r--xtesting/tests/unit/core/test_robotframework.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/xtesting/tests/unit/core/test_robotframework.py b/xtesting/tests/unit/core/test_robotframework.py
index 398cf87a..19c4e0f0 100644
--- a/xtesting/tests/unit/core/test_robotframework.py
+++ b/xtesting/tests/unit/core/test_robotframework.py
@@ -9,7 +9,6 @@
"""Define the classes required to fully cover robot."""
-import errno
import logging
import os
import unittest
@@ -194,14 +193,11 @@ class RunTesting(unittest.TestCase):
mmethod.asser_not_called()
@mock.patch('os.makedirs', side_effect=Exception)
+ @mock.patch('os.path.exists', return_value=False)
def test_makedirs_exc(self, *args):
self._test_makedirs_exc()
args[0].assert_called_once_with(self.test.res_dir)
-
- @mock.patch('os.makedirs', side_effect=OSError)
- def test_makedirs_oserror(self, *args):
- self._test_makedirs_exc()
- args[0].assert_called_once_with(self.test.res_dir)
+ args[1].assert_called_once_with(self.test.res_dir)
@mock.patch('robot.run')
def _test_makedirs(self, *args):
@@ -218,15 +214,19 @@ class RunTesting(unittest.TestCase):
mock_method.assert_called_once_with()
mmethod.assert_called_once_with()
- @mock.patch('os.makedirs', side_effect=OSError(errno.EEXIST, ''))
+ @mock.patch('os.makedirs')
+ @mock.patch('os.path.exists', return_value=True)
def test_makedirs_oserror17(self, *args):
self._test_makedirs()
args[0].assert_called_once_with(self.test.res_dir)
+ args[1].assert_not_called()
@mock.patch('os.makedirs')
+ @mock.patch('os.path.exists', return_value=False)
def test_makedirs(self, *args):
self._test_makedirs()
args[0].assert_called_once_with(self.test.res_dir)
+ args[1].assert_called_once_with(self.test.res_dir)
@mock.patch('os.makedirs')
@mock.patch('robot.run')