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]
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]
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]
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]
def test_two_different_args_raise(): """Should raise SystemExit.""" with pytest.raises(SystemExit): parse_args(["dateandtime", "-r", "-e"])
def test_two_args_the_same(defaults): """Shouldn't make a difference.""" defaults.update({"discordian": True}) assert parse_args(["dateandtime", "-d", "--discordian"]) == defaults
def test_one_arg(defaults): """Simple use case.""" defaults.update({"eve_game": True}) assert parse_args(["dateandtime", "-e"]) == defaults
def test_literally_no_args(defaults): """This shouldn't be possible, but it shouldn't break anything.""" assert parse_args() == defaults
def test_no_args(defaults): """Basic use case.""" assert parse_args(["dateandtime"]) == defaults