示例#1
0
def test_valid_option_multiple():
    parsed = hledac.parse_args(
        ['lipsum.txt', '-s', 'test testing testing some more'])
    assert parsed == ('lipsum.txt',
                      ['test', 'testing', 'testing', 'some', 'more'])
示例#2
0
def test_valid_option_single():
    parsed = hledac.parse_args(['lipsum.txt', '-s', 'test'])
    assert parsed == ('lipsum.txt', ['test'])
示例#3
0
def test_invalid_option():
    with pytest.raises(TypeError):
        hledac.parse_args(['lipsum.txt', '-s', 1])
示例#4
0
def test_empty_option():
    with pytest.raises(SystemExit):
        hledac.parse_args([
            'lipsum.txt',
            '-s',
        ])
示例#5
0
def test_toomany_arguments():
    with pytest.raises(SystemExit):
        hledac.parse_args(['Sdfsdf', 'sfsdfs', 'dgfdgdfg'])
示例#6
0
def test_no_argument():
    with pytest.raises(SystemExit):
        hledac.parse_args([])