コード例 #1
0
def test_split_args_cannot_find_matching_bracket():
    formatter = FileFormatter('filename.txt')
    formatter.set_contents("Money(foo")
    with pytest.raises(RuntimeError) as exc_info:
        formatter.split_args(6)
    assert str(exc_info.value
               ) == "Unable to find closing bracket for start position '6'"
コード例 #2
0
def test_split_args(actual, expected):
    formatter = FileFormatter('filename.txt')
    formatter.set_contents(actual)
    match = formatter.split_args(expected.start)
    assert len(match.args) == len(expected.args)
    assert match == expected