msztolcman / fileperms Goto Github PK
View Code? Open in Web Editor NEWfileperms is small library for Python for describing file permissions
Home Page: https://github.com/msztolcman/fileperms
License: MIT License
fileperms is small library for Python for describing file permissions
Home Page: https://github.com/msztolcman/fileperms
License: MIT License
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 =========================
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.