Exemplo n.º 1
0
    def testListGroupsNoArgument(self, capsys):
        self.args += ["listgroups"]
        self.cli.invoke(self.args, strict=True)

        out, err = capsys.readouterr()
        ids = get_group_ids(out)
        roles = self.sf.getAdminService().getSecurityRoles()
        assert ids == [roles.userGroupId, self.group.id.val]
Exemplo n.º 2
0
    def testInfoNoArgument(self, capsys):
        self.args += ["info"]
        self.cli.invoke(self.args, strict=True)

        # Read from the stdout
        out, err = capsys.readouterr()
        ids = get_group_ids(out)
        assert ids == [self.group.id.val]
Exemplo n.º 3
0
    def testInfoNoArgument(self, capsys):
        self.args += ["info"]
        self.cli.invoke(self.args, strict=True)

        # Read from the stdout
        out, err = capsys.readouterr()
        ids = get_group_ids(out)
        assert ids == [self.group.id.val]
Exemplo n.º 4
0
    def testList(self, capsys, sort_key, group_format):
        self.args += ["list"]
        if sort_key:
            self.args += ["--sort-by-%s" % sort_key]
        if group_format:
            self.args += ["--%s" % group_format]
        self.cli.invoke(self.args, strict=True)

        # Read from the stdout
        out, err = capsys.readouterr()
        ids = get_group_ids(out, sort_key=sort_key)

        # Check all groups are listed
        if sort_key == 'name':
            self.groups.sort(key=lambda x: x.name.val)
        else:
            self.groups.sort(key=lambda x: x.id.val)
        assert ids == [group.id.val for group in self.groups]
Exemplo n.º 5
0
    def testList(self, capsys, sort_key, group_format):
        self.args += ["list"]
        if sort_key:
            self.args += ["--sort-by-%s" % sort_key]
        if group_format:
            self.args += ["--%s" % group_format]
        self.cli.invoke(self.args, strict=True)

        # Read from the stdout
        out, err = capsys.readouterr()
        ids = get_group_ids(out, sort_key=sort_key)

        # Check all groups are listed
        if sort_key == 'name':
            self.groups.sort(key=lambda x: x.name.val)
        else:
            self.groups.sort(key=lambda x: x.id.val)
        assert ids == [group.id.val for group in self.groups]