示例#1
0
def test_type_string():
    check_parenthetics("string")
示例#2
0
def test_type_not_string():
    with pytest.raises(TypeError):
        check_parenthetics(1)
示例#3
0
def test_balanced():
    str = "(One(Two(Three)Two)One)"
    assert check_parenthetics(str) == 0
示例#4
0
def test_broken():
    str = "(One(Two(Three)Two)One)Zero)"
    assert check_parenthetics(str) == -1
示例#5
0
def test_open():
    str = "(One(Two(Three)Two)One"
    assert check_parenthetics(str) == 1