Example #1
0
def test_rule_str():
    assert str(Rule('ALPHA')) == "Rule('ALPHA')"
Example #2
0
def test_WSP(src):
    node, start = Rule('WSP').parse(src, 0)
    assert node and node.value == src
Example #3
0
def test_rule_undefined():
    with pytest.raises(GrammarError):
        Rule('undefined').parse('x', 0)
Example #4
0
def test_VCHAR(src):
    node, start = Rule('VCHAR').parse(src, 0)
    assert node and node.value == src
Example #5
0
def test_ALPHA(src):
    node, start = Rule('ALPHA').parse(src, 0)
    assert node and node.value == src
Example #6
0
def test_LF(src):
    node, start = Rule('LF').parse(src, 0)
    assert node and node.value == src
Example #7
0
def test_OCTET(src):
    node, start = Rule('OCTET').parse(src, 0)
    assert node and node.value == src
Example #8
0
def test_HTAB(src):
    node, start = Rule('HTAB').parse(src, 0)
    assert node and node.value == src
Example #9
0
def test_HEXDIG(src):
    node, start = Rule('HEXDIG').parse(src, 0)
    assert node and node.value == src
Example #10
0
def test_DQUOTE(src):
    node, start = Rule('DQUOTE').parse(src, 0)
    assert node and node.value == src
Example #11
0
def test_DIGIT(src):
    node, start = Rule('DIGIT').parse(src, 0)
    assert node and node.value == src
Example #12
0
def test_CTL(src):
    node, start = Rule('CTL').parse(src, 0)
    assert node and node.value == src