コード例 #1
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)
コード例 #2
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)
コード例 #3
0
 def test_update(self):
     user_fix = self.useFixture(fixtures.User(self.sentinel))
     user = self.sentinel.identity.users.update(
         user_fix.entity,
         name=TEST_USER,
         email=TEST_USER_EMAIL,
         description=TEST_USER_DESCRIPTION,
         enabled=False)
     self.assertEqual(user.name, TEST_USER)
     self.assertEqual(user.email, TEST_USER_EMAIL)
     self.assertEqual(user.description, TEST_USER_DESCRIPTION)
     self.assertEqual(user.enabled, False)
コード例 #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_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))
コード例 #7
0
 def test_list_filtering(self):
     user = self.useFixture(fixtures.User(self.openstack))
     users = self.sentinel.identity.users.list()
     self.assertThat(user.entity, matchers.IsNotInCollection(users))
コード例 #8
0
 def test_list(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     users = self.sentinel.identity.users.list()
     self.assertThat(user.entity, matchers.IsInCollection(users))
コード例 #9
0
 def test_delete_taint(self):
     user = self.useFixture(fixtures.User(self.openstack))
     self.assertRaises(http.Forbidden, self.sentinel.identity.users.delete,
                       user.entity)
コード例 #10
0
 def test_get(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     self.sentinel.identity.users.get(user.entity)
コード例 #11
0
 def test_update_taint(self):
     user = self.useFixture(fixtures.User(self.openstack))
     self.assertRaises(http.Forbidden,
                       self.sentinel.identity.users.update,
                       user.entity,
                       name=TEST_USER)
コード例 #12
0
 def test_create_conflict(self):
     user = self.useFixture(fixtures.User(self.sentinel))
     self.assertRaises(http.Conflict, self.sentinel.identity.users.create,
                       user.entity.name)