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'])
def test_valid_option_single(): parsed = hledac.parse_args(['lipsum.txt', '-s', 'test']) assert parsed == ('lipsum.txt', ['test'])
def test_invalid_option(): with pytest.raises(TypeError): hledac.parse_args(['lipsum.txt', '-s', 1])
def test_empty_option(): with pytest.raises(SystemExit): hledac.parse_args([ 'lipsum.txt', '-s', ])
def test_toomany_arguments(): with pytest.raises(SystemExit): hledac.parse_args(['Sdfsdf', 'sfsdfs', 'dgfdgdfg'])
def test_no_argument(): with pytest.raises(SystemExit): hledac.parse_args([])