Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")