def _getSmartIndenter(indenterName, qpart, indenter):
    """Get indenter by name.
    Available indenters are none, normal, cstyle, haskell, lilypond, lisp, python, ruby, xml
    Indenter name is not case sensitive
    Raise KeyError if not found
    indentText is indentation, which shall be used. i.e. '\t' for tabs, '    ' for 4 space symbols
    """
    indenterName = indenterName.lower()

    if indenterName in ('haskell', 'lilypond'):  # not supported yet
        logger.warning('Smart indentation for %s not supported yet. But you could be a hero who implemented it' % indenterName)
        from qutepart.indenter.base import IndentAlgNormal as indenterClass
    elif 'none' == indenterName:
        from qutepart.indenter.base import IndentAlgBase as indenterClass
    elif 'normal' == indenterName:
        from qutepart.indenter.base import IndentAlgNormal as indenterClass
    elif 'cstyle' == indenterName:
        from qutepart.indenter.cstyle import IndentAlgCStyle as indenterClass
    elif 'python' == indenterName:
        from qutepart.indenter.python import IndentAlgPython as indenterClass
    elif 'ruby' == indenterName:
        from qutepart.indenter.ruby import IndentAlgRuby as indenterClass
    elif 'xml' == indenterName:
        from qutepart.indenter.xmlindent import IndentAlgXml as indenterClass
    elif 'haskell' == indenterName:
        from qutepart.indenter.haskell import IndenterHaskell as indenterClass
    elif 'lilypond' == indenterName:
        from qutepart.indenter.lilypond import IndenterLilypond as indenterClass
    elif 'lisp' == indenterName:
        from qutepart.indenter.lisp import IndentAlgLisp as indenterClass
    elif 'scheme' == indenterName:
        from qutepart.indenter.scheme import IndentAlgScheme as indenterClass
    else:
        raise KeyError("Indenter %s not found" % indenterName)

    return indenterClass(qpart, indenter)
def test_when_verbose_and_single_good_output_expected_data_should_be_parsed():
    expected_data = {
        "roscivs": {
            "unix username": "roscivs",
            "nt username": "bottia",
            "full name": "Roscivs Bottia",
            "user sid": "42",
            "primary group sid": "99",
            "home directory": r"\\samba\roscivs",
            "account desc": "separators! xxx so long and thanks for all the fish",
            "logoff time": "Sat, 14 Aug 2010 15:06:39 UTC",
            "kickoff time": "Sat, 14 Aug 2010 15:06:39 UTC",
            "password must change": "never",
        }
    }
    pdb_output = dedent(
        r"""
        Unix username:        roscivs
        NT username:          bottia
        User SID:             42
        Primary Group SID:    99
        Full Name:            Roscivs Bottia
        Home Directory:       \\samba\roscivs
        Account desc:         separators! xxx so long and thanks for all the fish
        Logoff time:          Sat, 14 Aug 2010 15:06:39 UTC
        Kickoff time:         Sat, 14 Aug 2010 15:06:39 UTC
        Password must change: never
        """
    ).strip()

    with patch.dict(
        pdbedit.__salt__,
        {
            "cmd.run_all": MagicMock(
                return_value={"stdout": pdb_output, "stderr": "", "retcode": 0}
            )
        },
    ):
        actual_data = pdbedit.list_users(verbose=True)
        assert actual_data == expected_data