def test_track_cannot_read(no_sleep, mock_mainfunc, ptmpdir):
_, _, inotifier = mock_mainfunc
def add_watch(*args, **kwargs):
exc = IOError("Hello?")
exc.errno = errno.EPERM
raise exc
inotifier.add_watch.side_effect = add_watch
app = get_app()
app.destination_path = ptmpdir.join("filename").strpath
with pytest.raises(IOError):
app.track()
评论列表
文章目录