Example #1
0
def test_fdlistdir(tmpdir):
    tmpdir.join('file').write('text')
    dirfd = os.open(str(tmpdir), os.O_RDONLY)
    result = rposix.fdlistdir(dirfd)
    # Note: fdlistdir() always closes dirfd
    assert result == ['file']
Example #2
0
def test_fdlistdir(tmpdir):
    tmpdir.join('file').write('text')
    dirfd = os.open(str(tmpdir), os.O_RDONLY)
    result = rposix.fdlistdir(dirfd)
    # Note: fdlistdir() always closes dirfd
    assert result == ['file']
Example #3
0
def test_fdlistdir_rewinddir(tmpdir):
    tmpdir.join('file').write('text')
    dirfd = os.open(str(tmpdir), os.O_RDONLY)
    result1 = rposix.fdlistdir(os.dup(dirfd))
    result2 = rposix.fdlistdir(dirfd)
    assert result1 == result2 == ['file']
Example #4
0
def test_fdlistdir_rewinddir(tmpdir):
    tmpdir.join('file').write('text')
    dirfd = os.open(str(tmpdir), os.O_RDONLY)
    result1 = rposix.fdlistdir(os.dup(dirfd))
    result2 = rposix.fdlistdir(dirfd)
    assert result1 == result2 == ['file']