예제 #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([])