def test__parse_args_regex_long(): argv = ["email.txt", "--regex", r"\.txt$"] args = clingy._parse_args(argv) assert args.filenames == ["email.txt"] assert args.regex == "\.txt$"
def test__parse_args_glob_long(): argv = ["email.txt", "--glob", "*.txt"] args = clingy._parse_args(argv) assert args.filenames == ["email.txt"] assert args.glob == "*.txt"
def test__parse_args_directory_long(): argv = ["email.txt", "--directory", "out"] args = clingy._parse_args(argv) assert args.filenames == ["email.txt"] assert args.directory == "out"
def test__parse_args_multiple_emails(): argv = ["email1.txt", "email2.txt"] args = clingy._parse_args(argv) assert args.filenames == argv
def test__parse_args_one_email(): argv = ["email.txt"] args = clingy._parse_args(argv) assert args.filenames == argv
def test__parse_args_need_at_least_one_filename(): with pytest.raises(SystemExit): clingy._parse_args([])