mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Test OSError errno
This commit is contained in:
@@ -13,6 +13,12 @@ assert_raises(FileNotFoundError, lambda: os.open('DOES_NOT_EXIST', os.O_RDONLY))
|
||||
assert_raises(FileNotFoundError, lambda: os.open('DOES_NOT_EXIST', os.O_WRONLY))
|
||||
assert_raises(FileNotFoundError, lambda: os.rename('DOES_NOT_EXIST', 'DOES_NOT_EXIST 2'))
|
||||
|
||||
try:
|
||||
os.open('DOES_NOT_EXIST', 0)
|
||||
except OSError as err:
|
||||
assert err.errno == 2
|
||||
|
||||
|
||||
|
||||
assert os.O_RDONLY == 0
|
||||
assert os.O_WRONLY == 1
|
||||
|
||||
Reference in New Issue
Block a user