def test_move_file_exception_unpacking_unlink(self):
# see issue 22182
with patch("os.rename", side_effect=OSError(errno.EXDEV, "wrong")), \
patch("os.unlink", side_effect=OSError("wrong", 1)), \
self.assertRaises(DistutilsFileError):
with open(self.source, 'w') as fobj:
fobj.write('spam eggs')
move_file(self.source, self.target, verbose=0)
评论列表
文章目录