Exemple #1
0
 def test_unlink_ENOENT(self):
     with mock.patch.object(os, "unlink") as unlink_mock:
         unlink_mock.side_effect = OSError(errno.ENOENT)
         utils.unlink_without_raise("/fake/path")
         unlink_mock.assert_called_once_with("/fake/path")
Exemple #2
0
 def test_unlink_ENOENT(self):
     with mock.patch.object(os, "unlink") as unlink_mock:
         unlink_mock.side_effect = OSError(errno.ENOENT)
         utils.unlink_without_raise("/fake/path")
         unlink_mock.assert_called_once_with("/fake/path")
Exemple #3
0
 def test_unlink(self):
     with mock.patch.object(os, "unlink") as unlink_mock:
         unlink_mock.return_value = None
         utils.unlink_without_raise("/fake/path")
         unlink_mock.assert_called_once_with("/fake/path")
Exemple #4
0
 def test_unlink(self):
     with mock.patch.object(os, "unlink") as unlink_mock:
         unlink_mock.return_value = None
         utils.unlink_without_raise("/fake/path")
         unlink_mock.assert_called_once_with("/fake/path")