How to use the aioftp.Permission function in aioftp

To help you get started, we’ve selected a few aioftp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aio-libs / aioftp / tests / test_simple_functions.py View on Github external
def test_permission_is_parent():
    p = aioftp.Permission("/foo/bar")
    assert p.is_parent(pathlib.PurePosixPath("/foo/bar/baz"))
    assert not p.is_parent(pathlib.PurePosixPath("/bar/baz"))
github aio-libs / aioftp / tests / test_simple_functions.py View on Github external
def test_reprs_works():
    repr(aioftp.Throttle())
    repr(aioftp.Permission())
    repr(aioftp.User())
github aio-libs / aioftp / tests / test-repr.py View on Github external
def test_permission_representation():

    p = aioftp.Permission(writable=False)
    nose.tools.eq_(
        repr(p),
        "Permission(PurePosixPath('/'), readable=True, writable=False)"
    )