Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aiofiles.os.path.islink function #126

Merged
merged 2 commits into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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 <https://github.com/Tinche/aiofiles/pull/126>`_
* Added ``aiofiles.os.readlink``.
`#125 <https://github.com/Tinche/aiofiles/pull/125>`_
* Added ``aiofiles.os.symlink``.
`#124 <https://github.com/Tinche/aiofiles/pull/124>`_
* Added ``aiofiles.os.unlink``.
`#123 <https://github.com/Tinche/aiofiles/pull/123>`_
* Added ``aiofiles.os.link``.
`#121 <https://github.com/Tinche/aiofiles/pull/121>`_
* Added ``aiofiles.os.renames``.
`#120 <https://github.com/Tinche/aiofiles/pull/120>`_

0.8.0 (2021-11-27)
``````````````````
* aiofiles is now tested on Python 3.10.
Expand Down
1 change: 1 addition & 0 deletions src/aiofiles/ospath.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions tests/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down