Git Product home page Git Product logo

fileperms's People

Contributors

msztolcman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

lkabuci

fileperms's Issues

The tests are failed on python 3.10

  • /usr/bin/python3 -m pytest
    ============================= test session starts ==============================
    platform linux -- Python 3.10.4, pytest-6.2.4, py-1.11.0, pluggy-0.13.1
    rootdir: /builddir/build/BUILD/fileperms-1.0.4
    collected 22 items

test/test_from_filemode.py ... [ 13%]
test/test_from_int.py ... [ 27%]
test/test_from_octal.py ... [ 40%]
test/test_from_path.py ... [ 54%]
test/test_getter_setter.py .. [ 63%]
test/test_os_chmod.py F [ 68%]
test/test_pathlib.py F [ 72%]
test/test_to_filemode.py .. [ 81%]
test/test_to_int.py .. [ 90%]
test/test_to_octal.py .. [100%]

=================================== FAILURES ===================================
_______________________________ TestOsChmod.test _______________________________

self = <test_os_chmod.TestOsChmod object at 0x7f2fb0418bb0>

def test(self):
    perms = '0 1 2 3 4 5 6 7'.split()
    path = tempfile.mkstemp()[1]

    try:
        perms = itertools.product(perms, perms, perms, perms)
        for item in perms:
            item = ''.join(item)
            assert len(item) == 4

            prm = Permissions.from_octal(item)
          os.lchmod(path, prm)

E AttributeError: module 'os' has no attribute 'lchmod'

test/test_os_chmod.py:21: AttributeError
_______________________________ TestPathlib.test _______________________________

self = <test_pathlib.TestPathlib object at 0x7f2fb04187f0>

def test(self):
    perms = '0 1 2 3 4 5 6 7'.split()
    path = pathlib.Path(tempfile.mkstemp()[1])

    try:
        perms = itertools.product(perms, perms, perms, perms)
        for item in perms:
            item = ''.join(item)
            assert len(item) == 4

            prm = Permissions.from_octal(item)
          path.lchmod(prm)

test/test_pathlib.py:22:


/usr/lib64/python3.10/pathlib.py:1196: in lchmod
self.chmod(mode, follow_symlinks=False)


self = PosixPath('/tmp/tmp9n1_opd2'), mode = <Permissions(0000)>

def chmod(self, mode, *, follow_symlinks=True):
    """
    Change the permissions of the path, like os.chmod().
    """
  self._accessor.chmod(self, mode, follow_symlinks=follow_symlinks)

E TypeError: 'Permissions' object cannot be interpreted as an integer

/usr/lib64/python3.10/pathlib.py:1189: TypeError
=========================== short test summary info ============================
FAILED test/test_os_chmod.py::TestOsChmod::test - AttributeError: module 'os'...
FAILED test/test_pathlib.py::TestPathlib::test - TypeError: 'Permissions' obj...
========================= 2 failed, 20 passed in 0.18s =========================

[1.1.0] tests fails on Python 3.10 on Linux

  • /usr/bin/pytest
    ============================= test session starts ==============================
    platform linux -- Python 3.10.4, pytest-6.2.4, py-1.11.0, pluggy-0.13.1
    rootdir: /builddir/build/BUILD/fileperms-1.1.0, configfile: tox.ini, testpaths: test
    collected 26 items

test/test_from_filemode.py .... [ 15%]
test/test_from_int.py .... [ 30%]
test/test_from_octal.py .... [ 46%]
test/test_from_path.py .... [ 61%]
test/test_getter_setter.py .. [ 69%]
test/test_os_chmod.py F [ 73%]
test/test_pathlib.py . [ 76%]
test/test_to_filemode.py .. [ 84%]
test/test_to_int.py .. [ 92%]
test/test_to_octal.py .. [100%]

=================================== FAILURES ===================================
_______________________________ TestOsChmod.test _______________________________

self = <test_os_chmod.TestOsChmod object at 0x7f319ec334c0>

def test(self):
    perms = '0 1 2 3 4 5 6 7'.split()
    path = tempfile.mkstemp()[1]

    try:
        perms = itertools.product(perms, perms, perms, perms)
        for item in perms:
            item = ''.join(item)
            assert len(item) == 4

            prm = Permissions.from_octal(item)
          os.lchmod(path, int(prm))

E AttributeError: module 'os' has no attribute 'lchmod'

test/test_os_chmod.py:21: AttributeError
=========================== short test summary info ============================
FAILED test/test_os_chmod.py::TestOsChmod::test - AttributeError: module 'os'...
========================= 1 failed, 25 passed in 0.34s =========================

As far as I know the lchmod was undefined in python <3.10 and removed under 3.10 for Linux.
python/cpython#51728.
So this test is only useful for some Unix systems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.