def test_users_client(self):
        self.init()

        # Since the UsersClient can't currently create a user, as a work around
        # we create a new group, get the group, and use the group owner as
        # the user to try and get using the user client.
        groups_client = GroupsClient(self.cert_file)
        group = Group(GroupsClientIntTest.get_group_id("py1"))

        try:
            groups_client.create_group(group)
        except Exception, e:
            self.fail("Error creating group because {0}".format(repr(e)))
    def test_users_client(self):
        self.init()

        # Since the UsersClient can't currently create a user, as a work around
        # we create a new group, get the group, and use the group owner as
        # the user to try and get using the user client.
        groups_client = GroupsClient(self.cert_file)
        group = Group(GroupsClientIntTest.get_group_id('py1'))

        try:
            groups_client.create_group(group)
        except Exception, e:
            self.fail('Error creating group because {0}'.format(repr(e)))
    def test_groups_client(self):
        self.init()

        # Use the first version for lots of debugging information
        # client = GroupsClient(self.cert_file, log_level=logging.DEBUG)
        client = GroupsClient(self.cert_file)

        # create a group
        expected = Group(self.get_group_id("py1"))
        expected.description = "group description"
        print "expected group {0}".format(expected)

        try:
            client.create_group(expected)
        except Exception, e:
            self.fail("Error creating group because {0}".format(repr(e)))
    def test_groups_client(self):
        self.init()

        # Use the first version for lots of debugging information
        #client = GroupsClient(self.cert_file, log_level=logging.DEBUG)
        client = GroupsClient(self.cert_file)

        # create a group
        expected = Group(self.get_group_id('py1'))
        expected.description = 'group description'
        print 'expected group {0}'.format(expected)

        try:
            client.create_group(expected)
        except Exception, e:
            self.fail('Error creating group because {0}'.format(repr(e)))
    def test_groups_client(self):
        self.init()

        # Use the first version for lots of debugging information
        #client = GroupsClient(self.cert_file, log_level=logging.DEBUG)
        client = GroupsClient(self.cert_file)

        # create the owner
        owner = User(Identity(client.current_user_dn, 'X500'))

        # create a group
        expected = Group(self.get_group_id('py1'), owner)
        expected.description = 'group description'
        print 'expected group ' + expected

        try:
            client.create_group(expected)
        except Exception, e:
            self.fail('Error creating group because ' + repr(e))