(path, flags)
| 50 | builtins.memoryview = _MockMemoryviewMeta("memoryview", (), {'__new__': _memoryview}) # type: ignore |
| 51 | |
| 52 | def _open(path, flags): |
| 53 | for d in drivers: |
| 54 | for x in d.tracked_files: |
| 55 | if path == x.path: |
| 56 | virtfd = d.open(path, flags, 0o777, x) |
| 57 | tracked_fds[virtfd.fd] = virtfd |
| 58 | return virtfd.fd |
| 59 | return os.open(path, flags, 0o777) if os.path.exists(path) else None |
| 60 | |
| 61 | class MockFileIOInterface(FileIOInterface): |
| 62 | def __init__(self, path:str="", flags:int=os.O_RDONLY, fd:int|None=None): |