Beispiel #1
0
def test_original_parser():
    with wrap() as wrapper:
        conf = """{
        "*.txt" : {}
        }"""

        parser = OriginalDexyParser()
        parser.wrapper = wrapper
        parser.parse(conf)

        assert wrapper.docs[0].key_with_class() == "PatternDoc:*.txt"
Beispiel #2
0
def test_original_parser_allinputs():
    with wrap() as wrapper:
        conf = """{
        "*.txt" : {},
        "hello.txt" : { "contents" : "Hello!" },
        "*.md|jinja" : { "allinputs" : true }
        }"""

        parser = OriginalDexyParser(wrapper)
        parser.wrapper = wrapper
        parser.parse(conf)

        assert wrapper.docs[0].key_with_class() == "PatternDoc:*.txt"
        assert wrapper.docs[1].key_with_class() == "Doc:hello.txt"
        assert wrapper.docs[2].key_with_class() == "PatternDoc:*.md|jinja"