예제 #1
0
 def test_update(self):
     group_fix = self.useFixture(fixtures.Group(self.sentinel))
     group = self.sentinel.identity.groups.update(
         group_fix.entity,
         name=TEST_GROUP,
         description=TEST_GROUP_DESCRIPTION)
     self.assertEqual(group.name, TEST_GROUP)
     self.assertEqual(group.description, TEST_GROUP_DESCRIPTION)
예제 #2
0
 def test_group_has_user(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.assertRaises(http.NotFound,
                       self.sentinel.identity.users.check_in_group,
                       user.entity, group.entity)
     self.sentinel.identity.users.add_to_group(user.entity, group.entity)
     self.sentinel.identity.users.check_in_group(user.entity, group.entity)
예제 #3
0
 def def_group_remove_user(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.sentinel.identity.users.add_to_group(user.entity, group.entity)
     self.sentinel.identity.users.remove_from_group(user.entity,
                                                    group.entity)
     self.assertRaises(http.NotFound,
                       self.sentinel.identity.users.remove_from_group,
                       user.entity, group.entity)
예제 #4
0
 def test_group_add_user_taint(self):
     user = self.useFixture(fixtures.User(self.openstack))
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.assertRaises(http.Forbidden,
                       self.sentinel.identity.users.add_to_group,
                       user.entity, group.entity)
예제 #5
0
 def test_group_add_user(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.sentinel.identity.users.add_to_group(user.entity, group.entity)
예제 #6
0
 def test_list_filtering(self):
     group = self.useFixture(fixtures.Group(self.openstack))
     groups = self.sentinel.identity.groups.list()
     self.assertThat(group.entity, matchers.IsNotInCollection(groups))
예제 #7
0
 def test_list(self):
     group = self.useFixture(fixtures.Group(self.sentinel))
     groups = self.sentinel.identity.groups.list()
     self.assertThat(group.entity, matchers.IsInCollection(groups))
예제 #8
0
 def test_delete_taint(self):
     group = self.useFixture(fixtures.Group(self.openstack))
     self.assertRaises(http.Forbidden, self.sentinel.identity.groups.delete,
                       group.entity)
예제 #9
0
 def test_get(self):
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.sentinel.identity.groups.get(group.entity)
예제 #10
0
 def test_update_taint(self):
     group = self.useFixture(fixtures.Group(self.openstack))
     self.assertRaises(http.Forbidden,
                       self.sentinel.identity.groups.update,
                       group.entity,
                       name=TEST_GROUP)
예제 #11
0
 def test_create_conflict(self):
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.assertRaises(http.Conflict, self.sentinel.identity.groups.create,
                       group.entity.name)
예제 #12
0
 def test_group_list_users(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     group = self.useFixture(fixtures.Group(self.sentinel))
     self.sentinel.identity.users.add_to_group(user.entity, group.entity)
     users = self.sentinel.identity.users.list(group=group.entity)
     self.assertThat(user.entity, matchers.IsInCollection(users))