def test_cmd_line_arguments():
    """Ensure we return the options from the argparser correctly."""

    fake_args = [
        "--count",
        "10",
        "--delay",
        "20",
        "--style",
        "3",
        "--width",
        "40",
        "--left-padding",
        "left",
        "--right-padding",
        "right",
    ]

    ret = progressbar.cmd_line_arguments(fake_args)

    assert ret.count == 10
    assert ret.delay == 20.0
    assert ret.style == 3
    assert ret.width == 40
    assert ret.left_padding == "left"
    assert ret.right_padding == "right"
Exemple #2
0
def test_cmd_line_arguments():
    """Ensure we return the options from the argparser correctly."""

    fake_args = [
        "--count", "10", "--delay", "20", "--style", "3", "--width", "40",
        "--left-padding", "left", "--right-padding", "right"
    ]

    ret = progressbar.cmd_line_arguments(fake_args)

    assert ret.count == 10
    assert ret.delay == 20.0
    assert ret.style == 3
    assert ret.width == 40
    assert ret.left_padding == "left"
    assert ret.right_padding == "right"
def test_cmd_line_help():
    """Ensure we raise sysexit when --help is used."""

    with pytest.raises(SystemExit):
        progressbar.cmd_line_arguments(["--help"])
Exemple #4
0
def test_cmd_line_help():
    """Ensure we raise sysexit when --help is used."""

    with pytest.raises(SystemExit):
        progressbar.cmd_line_arguments(["--help"])