예제 #1
0
 def test_get_or_replace_acls_when_replacing_an_acl(self):
     added_acl = ACL(user='******', zone='humgen', permission='OWN')
     BatonCollectionAPI.add_or_replace_acl(self.path, added_acl)
     acls_set = BatonCollectionAPI.get_acls(self.path)
     self.assertSetEqual(acls_set, {added_acl})
     replacement_acl = ACL(user='******', zone='humgen', permission='READ')
     BatonCollectionAPI.add_or_replace_acl(self.path, replacement_acl)
     acls_set = BatonCollectionAPI.get_acls(self.path)
     self.assertSetEqual(acls_set, {replacement_acl})
예제 #2
0
 def setUp(self):
     self.path = "/humgen/projects/serapis_staging/test-baton/test-collection-acls"
     BatonCollectionAPI.remove_all_acls(self.path)
     self.acl = ACL(user='******', zone='humgen', permission='READ')
     BatonCollectionAPI.add_or_replace_acl(self.path, self.acl)
     existing_acls = BatonCollectionAPI.get_acls(self.path)
     self.assertEqual(len(existing_acls), 1)
예제 #3
0
 def test_add_or_replace_a_list_of_acls(self):
     self.acls = [
         ACL(user='******', zone='humgen', permission='READ'),
         ACL(user='******', zone='humgen', permission='READ')
     ]
     BatonCollectionAPI.add_or_replace_a_list_of_acls(self.path, self.acls)
     self.acls_set = BatonCollectionAPI.get_acls(self.path)
     self.assertEqual(len(self.acls_set), 2)
예제 #4
0
 def test_get_or_replace_acls_when_adding_a_new_acl(self):
     added_acl = ACL(user='******', zone='humgen', permission='OWN')
     BatonCollectionAPI.add_or_replace_acl(self.path, added_acl)
     acls_set = BatonCollectionAPI.get_acls(self.path)
     found = False
     for acl in acls_set:
         if acl == added_acl:
             found = True
     self.assertTrue(found)
예제 #5
0
 def setUp(self):
     self.fpath = "/humgen/projects/serapis_staging/test-baton/test-collection-acls"
     self.acls = [
         ACL(user='******', zone='humgen', permission='READ'),
         ACL(user='******', zone='humgen', permission='READ')
     ]
     BatonCollectionAPI.add_or_replace_a_list_of_acls(self.fpath, self.acls)
     self.acls_set = BatonCollectionAPI.get_acls(self.fpath)
     self.assertNotEqual(len(self.acls_set), 0)
예제 #6
0
 def test_remove_acls_for_a_list_of_users(self):
     BatonCollectionAPI.remove_acls_for_a_list_of_users(self.path, [(self.acl.user, self.acl.zone)])
     existing_acls = BatonCollectionAPI.get_acls(self.path)
     self.assertEqual(0, len(existing_acls))
예제 #7
0
 def test_remove_all_acls(self):
     BatonCollectionAPI.remove_all_acls(self.fpath)
     acls_set = BatonCollectionAPI.get_acls(self.fpath)
     self.assertEqual(set(), acls_set)