def METHOD_NAME():
    """
    Test if it lists the available groups
    """
    def cmdlist(cmd, **kwargs):
        """
        Handle several different commands being run
        """
        if cmd == ["pacman", "-Sgg"]:
            return (
                "group-a pkg1\ngroup-a pkg2\ngroup-f pkg9\ngroup-c pkg3\ngroup-b pkg4"
            )
        elif cmd == ["pacman", "-Qg"]:
            return "group-a pkg1\ngroup-b pkg4"
        else:
            return "Untested command ({}, {})!".format(cmd, kwargs)
    cmdmock = MagicMock(side_effect=cmdlist)
    sortmock = MagicMock()
    with patch.dict(
        pacman.__salt__, {"cmd.run": cmdmock, "pkg_resource.sort_pkglist": sortmock}
    ):
        assert pacman.group_list() == {
            "available": ["group-c", "group-f"],
            "installed": ["group-b"],
            "partially_installed": ["group-a"],
        }