Rev | Line | |
---|
[2599] | 1 | import nose |
---|
| 2 | import afs.acl as acl |
---|
| 3 | |
---|
| 4 | def test_showRights(): |
---|
| 5 | assert acl.showRights(acl.READ | acl.WRITE) == "rw" |
---|
| 6 | |
---|
| 7 | def 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 | |
---|
| 12 | def 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 | |
---|
| 16 | def test_getCallerAccess(): |
---|
| 17 | assert acl.getCallerAccess('/afs/athena.mit.edu/contrib/bitbucket2') & acl.WRITE |
---|
| 18 | |
---|
| 19 | if __name__ == '__main__': |
---|
| 20 | nose.main() |
---|
| 21 | |
---|
Note: See
TracBrowser
for help on using the repository browser.