ACL implementation. Current features:
[invirt/packages/python-afs.git] / afs / tests / test_acl.py
diff --git a/afs/tests/test_acl.py b/afs/tests/test_acl.py
new file mode 100644 (file)
index 0000000..385e2ad
--- /dev/null
@@ -0,0 +1,18 @@
+import nose
+import afs.acl as acl
+
+def test_crights():
+    assert acl.crights('read') & acl.READ
+    assert acl.crights('read') & acl.LOOKUP
+    assert not acl.crights('read') & acl.WRITE
+
+def test_retrieve():
+    assert acl.ACL.retrieve('/afs/athena.mit.edu/contrib/bitbucket2').pos['system:anyuser'] & acl.WRITE
+    assert acl.ACL.retrieve('/afs/athena.mit.edu/user/t/a/tabbott').neg['yuranlu'] & acl.USR0
+
+def test_getCallerAccess():
+    assert acl.getCallerAccess('/afs/athena.mit.edu/contrib/bitbucket2') & acl.WRITE
+
+if __name__ == '__main__':
+    nose.main()
+