You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importerrnoimportosimportpytest## Note: you need to install pyfakefs==4.0.2 to make the 'fs' fixture availabledeftest_fakefs(fs): # pytest: disable=invalid-name# "fs" is the reference to the fake file systemfs.set_disk_usage(100) # bytesfname='/var/data/xx1.txt'fs.create_file(fname)
assertos.path.exists(fname)
withopen(fname, 'w') asfhandle:
fhandle.write("a"*80)
withpytest.raises(OSError) asexcinfo:
withopen(fname, 'w') asfhandle:
fhandle.write("a"*120)
print(dir(excinfo))
assertexcinfo.value.errno==errno.ENOSPC
One of the most common errors that users will face is a full disk. We need to assess that the implementation is at least robust against these errors.
We should check if using pyfakefs can help in testing these cases, and add tests for those.
The text was updated successfully, but these errors were encountered: