diff --git a/README.rst b/README.rst index be1d1a1..289b891 100644 --- a/README.rst +++ b/README.rst @@ -102,15 +102,21 @@ several useful ``os`` functions that deal with files: * ``stat`` * ``sendfile`` * ``rename`` +* ``renames`` * ``replace`` * ``remove`` +* ``unlink`` * ``mkdir`` * ``makedirs`` * ``rmdir`` * ``removedirs`` +* ``link`` +* ``symlink`` +* ``readlink`` * ``path.exists`` * ``path.isfile`` * ``path.isdir`` +* ``path.islink`` * ``path.getsize`` * ``path.getatime`` * ``path.getctime`` @@ -165,6 +171,21 @@ as desired. The return type also needs to be registered with the History ~~~~~~~ +0.9.0 (TBC) +`````````````````` +* Added ``aiofiles.os.path.islink``. + `#126 `_ +* Added ``aiofiles.os.readlink``. + `#125 `_ +* Added ``aiofiles.os.symlink``. + `#124 `_ +* Added ``aiofiles.os.unlink``. + `#123 `_ +* Added ``aiofiles.os.link``. + `#121 `_ +* Added ``aiofiles.os.renames``. + `#120 `_ + 0.8.0 (2021-11-27) `````````````````` * aiofiles is now tested on Python 3.10. diff --git a/src/aiofiles/ospath.py b/src/aiofiles/ospath.py index 8bb460a..a0a60f7 100644 --- a/src/aiofiles/ospath.py +++ b/src/aiofiles/ospath.py @@ -6,6 +6,7 @@ exists = wrap(path.exists) isfile = wrap(path.isfile) isdir = wrap(path.isdir) +islink = wrap(path.islink) getsize = wrap(path.getsize) getmtime = wrap(path.getmtime) getatime = wrap(path.getatime) diff --git a/tests/test_os.py b/tests/test_os.py index d496b41..25682a9 100644 --- a/tests/test_os.py +++ b/tests/test_os.py @@ -192,6 +192,16 @@ async def test_isdir(): assert result +@pytest.mark.asyncio +async def test_islink(): + """Test the path.islink call.""" + src_filename = join(dirname(__file__), "resources", "test_file1.txt") + dst_filename = join(dirname(__file__), "resources", "test_file2.txt") + await aiofiles.os.symlink(src_filename, dst_filename) + assert await aiofiles.os.path.islink(dst_filename) + await aiofiles.os.remove(dst_filename) + + @pytest.mark.asyncio async def test_getsize(): """Test path.getsize call."""