Exemple #1
0
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$"
Exemple #2
0
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"
Exemple #3
0
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"
Exemple #4
0
def test__parse_args_multiple_emails():
    argv = ["email1.txt", "email2.txt"]
    args = clingy._parse_args(argv)
    assert args.filenames == argv
Exemple #5
0
def test__parse_args_one_email():
    argv = ["email.txt"]
    args = clingy._parse_args(argv)
    assert args.filenames == argv
Exemple #6
0
def test__parse_args_need_at_least_one_filename():
    with pytest.raises(SystemExit):
        clingy._parse_args([])