Ejemplo n.º 1
0
def test_help_raise(mock_init):
    # Note that match only matches until the linebreak character.
    with pytest.raises(
            ValueError,
            match="'invalid_param' is not a valid bibmanager config parameter."
    ):
        cm.help("invalid_param")
Ejemplo n.º 2
0
def test_help_style(capsys, mock_init):
    styles = textwrap.fill(", ".join(style for style in iter(STYLE_MAP)),
                           width=79,
                           initial_indent="  ",
                           subsequent_indent="  ")
    cm.help("style")
    captured = capsys.readouterr()
    assert captured.out == f"""
Ejemplo n.º 3
0
def test_help_raise(mock_init):
    #config = configparser.ConfigParser()
    #config.read(u.HOME+'config')
    #errorlog = ("'invalid_param' is not a valid bibmanager config parameter.\n"
    #            "The available parameters are:\n"
    #           f"  {config.options('BIBMANAGER')}")

    # TBD: match only matches until the linebreak character.
    with pytest.raises(ValueError, 
           match="'invalid_param' is not a valid bibmanager config parameter."):
        cm.help("invalid_param")
Ejemplo n.º 4
0
def test_help_home(capsys, mock_init):
    cm.help("home")
    captured = capsys.readouterr()
    assert captured.out == f"""
Ejemplo n.º 5
0
def test_help_ads_display(capsys, mock_init):
    cm.help("ads_display")
    captured = capsys.readouterr()
    assert captured.out == """
Ejemplo n.º 6
0
def test_help_paper(capsys, mock_init):
    cm.help("paper")
    captured = capsys.readouterr()
    assert captured.out == """
Ejemplo n.º 7
0
def test_help_editor(capsys, mock_init):
    cm.help("text_editor")
    captured = capsys.readouterr()
    assert captured.out == """