ACL implementation. Current features:
[invirt/packages/python-afs.git] / afs / tests / test_acl.py
1 import nose
2 import afs.acl as acl
3
4 def test_crights():
5     assert acl.crights('read') & acl.READ
6     assert acl.crights('read') & acl.LOOKUP
7     assert not acl.crights('read') & acl.WRITE
8
9 def test_retrieve():
10     assert acl.ACL.retrieve('/afs/athena.mit.edu/contrib/bitbucket2').pos['system:anyuser'] & acl.WRITE
11     assert acl.ACL.retrieve('/afs/athena.mit.edu/user/t/a/tabbott').neg['yuranlu'] & acl.USR0
12
13 def test_getCallerAccess():
14     assert acl.getCallerAccess('/afs/athena.mit.edu/contrib/bitbucket2') & acl.WRITE
15
16 if __name__ == '__main__':
17     nose.main()
18