source: trunk/packages/python-afs/afs/tests/test_acl.py @ 2620

Last change on this file since 2620 was 2599, checked in by broder, 15 years ago

Import python-afs.

Debathena should eventually be importing PyAFS for
<http://debathena.mit.edu/trac/ticket/395>, so hopefully this is only
temporary.

File size: 659 bytes
Line 
1import nose
2import afs.acl as acl
3
4def test_showRights():
5    assert acl.showRights(acl.READ | acl.WRITE) == "rw"
6
7def test_readRights():
8    assert acl.readRights('read') & acl.READ
9    assert acl.readRights('read') & acl.LOOKUP
10    assert not acl.readRights('read') & acl.WRITE
11
12def test_retrieve():
13    assert acl.ACL.retrieve('/afs/athena.mit.edu/contrib/bitbucket2').pos['system:anyuser'] & acl.WRITE
14    assert acl.ACL.retrieve('/afs/athena.mit.edu/user/t/a/tabbott').neg['yuranlu'] & acl.USR0
15
16def test_getCallerAccess():
17    assert acl.getCallerAccess('/afs/athena.mit.edu/contrib/bitbucket2') & acl.WRITE
18
19if __name__ == '__main__':
20    nose.main()
21
Note: See TracBrowser for help on using the repository browser.