diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_libufps.py b/tests/test_libufps.py new file mode 100644 index 0000000..c627fd7 --- /dev/null +++ b/tests/test_libufps.py @@ -0,0 +1 @@ +import libufps diff --git a/tests/testfiles/0644 b/tests/testfiles/0644 new file mode 100644 index 0000000..332bab3 --- /dev/null +++ b/tests/testfiles/0644 @@ -0,0 +1 @@ +File permissions should equal 0644 diff --git a/tests/testfiles/linktests/link b/tests/testfiles/linktests/link new file mode 120000 index 0000000..13c5708 --- /dev/null +++ b/tests/testfiles/linktests/link @@ -0,0 +1 @@ +linkdir/ \ No newline at end of file diff --git a/tests/testfiles/linktests/linkdir/linkfile b/tests/testfiles/linktests/linkdir/linkfile new file mode 100644 index 0000000..e69de29 diff --git a/tests/testfiles/linktests/linkfile b/tests/testfiles/linktests/linkfile new file mode 100644 index 0000000..e69de29 diff --git a/ufpsutil.py b/ufpsutil.py new file mode 100644 index 0000000..8081233 --- /dev/null +++ b/ufpsutil.py @@ -0,0 +1,12 @@ +from libufps import ufps +from inspect import getmembers, isfunction +print(getmembers(ufps, isfunction)) + +basedir = "." + +ufps = ufps.ufps(basedir) + +print("Regular dir: " + str(ufps.getFilePermissions("tests/testfiles/")) + " | " + str(ufps.getFileOwner("tests/testfiles/"))) +print("Regular file: " + str(ufps.getFilePermissions("tests/testfiles/0644")) + " | " + str(ufps.getFileOwner("tests/testfiles/0644"))) +print("Linked dir: " + str(ufps.getFilePermissions("tests/testfiles/linktests/link")) + " | " + str(ufps.getFileOwner("tests/testfiles/linktests/link"))) +print("Linked file: " + str(ufps.getFilePermissions("tests/testfiles/linktests/linkfile")) + " | " + str(ufps.getFileOwner("tests/testfiles/linktests/linkfile")))