Exemple #1
0
def test_two_raise_content_two():
    """Test the ording of the sys exit being raised."""

    with pytest.raises(SystemExit) as error:
        parse_args(["dateandtime", "-r", "-e"])

    expected = (
        "Please limit yourself to a single calendar.\nI cannot display "
        "eve game and eve real at the same time :/")
    assert expected == error.value.args[0]
Exemple #2
0
def test_two_raise_content_two():
    """Test the ording of the sys exit being raised."""

    with pytest.raises(SystemExit) as error:
        parse_args(["dateandtime", "-r", "-e"])

    expected = (
        "Please limit yourself to a single calendar.\nI cannot display "
        "eve game and eve real at the same time :/"
    )
    assert expected == error.value.args[0]
Exemple #3
0
def test_help_message():
    """Ensure the test message looks correct."""

    with pytest.raises(SystemExit) as error:
        parse_args(["dateandtime", "-h"])

    expected = (
        "Dateandtime usage:\n  dateandtime [calendar] [-h/--help]\n"
        "Alternate calendars (usage flags):\n  Discordian: [-d, --discord,"
        " --discordian, --discordianism]\n  Eve (game): [-e, --eve, --eve-"
        "game]\n  Eve (real): [-r, --eve-real, --eve-is-real]")
    assert expected == error.value.args[0]
Exemple #4
0
def test_help_message():
    """Ensure the test message looks correct."""

    with pytest.raises(SystemExit) as error:
        parse_args(["dateandtime", "-h"])

    expected = (
        "Dateandtime usage:\n  dateandtime [calendar] [-h/--help]\n"
        "Alternate calendars (usage flags):\n  Discordian: [-d, --discord,"
        " --discordian, --discordianism]\n  Eve (game): [-e, --eve, --eve-"
        "game]\n  Eve (real): [-r, --eve-real, --eve-is-real]"
    )
    assert expected == error.value.args[0]
Exemple #5
0
def test_two_different_args_raise():
    """Should raise SystemExit."""

    with pytest.raises(SystemExit):
        parse_args(["dateandtime", "-r", "-e"])
Exemple #6
0
def test_two_args_the_same(defaults):
    """Shouldn't make a difference."""

    defaults.update({"discordian": True})
    assert parse_args(["dateandtime", "-d", "--discordian"]) == defaults
Exemple #7
0
def test_one_arg(defaults):
    """Simple use case."""

    defaults.update({"eve_game": True})
    assert parse_args(["dateandtime", "-e"]) == defaults
Exemple #8
0
def test_literally_no_args(defaults):
    """This shouldn't be possible, but it shouldn't break anything."""

    assert parse_args() == defaults
Exemple #9
0
def test_no_args(defaults):
    """Basic use case."""

    assert parse_args(["dateandtime"]) == defaults
Exemple #10
0
def test_two_different_args_raise():
    """Should raise SystemExit."""

    with pytest.raises(SystemExit):
        parse_args(["dateandtime", "-r", "-e"])
Exemple #11
0
def test_two_args_the_same(defaults):
    """Shouldn't make a difference."""

    defaults.update({"discordian": True})
    assert parse_args(["dateandtime", "-d", "--discordian"]) == defaults
Exemple #12
0
def test_one_arg(defaults):
    """Simple use case."""

    defaults.update({"eve_game": True})
    assert parse_args(["dateandtime", "-e"]) == defaults
Exemple #13
0
def test_literally_no_args(defaults):
    """This shouldn't be possible, but it shouldn't break anything."""

    assert parse_args() == defaults
Exemple #14
0
def test_no_args(defaults):
    """Basic use case."""

    assert parse_args(["dateandtime"]) == defaults