X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/23b00fba3a6e5f2822bf57ab0d114d486fc4ff1f..e328d3f22890be98db114267141c237217f372b1:/afs/tests/test__pts.py diff --git a/afs/tests/test__pts.py b/afs/tests/test__pts.py index d52a066..64297b1 100644 --- a/afs/tests/test__pts.py +++ b/afs/tests/test__pts.py @@ -20,5 +20,26 @@ def test_init_other_cell(): p = PTS('zone.mit.edu') assert p.cell == cell, "PTS doesn't initialize to provided cell." +def test_user_name_to_id(): + p = PTS() + name = 'broder' + id = p._NameToId(name) + assert id == 41803, "PTS can't convert user name to ID." + assert p._IdToName(id) == name, "PTS can't convert user ID to name." + +def test_group_name_to_id(): + p = PTS() + name = 'system:administrators' + id = p._NameToId(name) + assert id == -204, "PTS can't convert group name to ID." + assert p._IdToName(id) == name, "PTS can't convert group ID to name." + +def test_name_or_id(): + p = PTS() + name = 'system:administrators' + id = -204 + assert p._NameOrId(name) == id, "PTS._NameOrId can't identify name." + assert p._NameOrId(id) == id, "PTS._NameOrId can't identify ID." + if __name__ == '__main__': nose.main()