Esempio n. 1
0
def test_original_parser():
    with wrap() as wrapper:
        wrapper.nodes = {}
        wrapper.roots = []
        wrapper.batch = dexy.batch.Batch(wrapper)
        wrapper.filemap = wrapper.map_files()

        conf = """{
        "*.txt" : {}
        }"""
        ast = AbstractSyntaxTree(wrapper)
        parser = Original(wrapper, ast)
        parser.parse('.', conf)
        ast.walk()

        assert wrapper.roots[0].key_with_class() == "pattern:*.txt"
Esempio n. 2
0
def test_original_parser():
    with wrap() as wrapper:
        wrapper.nodes = {}
        wrapper.roots = []
        wrapper.batch = dexy.batch.Batch(wrapper)
        wrapper.filemap = wrapper.map_files()

        conf = """{
        "*.txt" : {}
        }"""
        ast = AbstractSyntaxTree(wrapper)
        parser = Original(wrapper, ast)
        parser.parse('.', conf)
        ast.walk()

        assert wrapper.roots[0].key_with_class() == "pattern:*.txt"
Esempio n. 3
0
def test_original_parser_allinputs():
    with wrap() as wrapper:
        wrapper.nodes = {}
        wrapper.roots = []
        wrapper.batch = dexy.batch.Batch(wrapper)
        wrapper.filemap = wrapper.map_files()

        conf = """{
        "*.txt" : {},
        "hello.txt" : { "contents" : "Hello!" },
        "*.md|jinja" : { "allinputs" : true }
        }"""

        ast = AbstractSyntaxTree(wrapper)
        parser = Original(wrapper, ast)
        parser.parse('.', conf)
        ast.walk()

        assert len(wrapper.roots) == 1
        assert wrapper.roots[0].key_with_class() == "pattern:*.md|jinja"
Esempio n. 4
0
def test_original_parser_allinputs():
    with wrap() as wrapper:
        wrapper.nodes = {}
        wrapper.roots = []
        wrapper.batch = dexy.batch.Batch(wrapper)
        wrapper.filemap = wrapper.map_files()

        conf = """{
        "*.txt" : {},
        "hello.txt" : { "contents" : "Hello!" },
        "*.md|jinja" : { "allinputs" : true }
        }"""

        ast = AbstractSyntaxTree(wrapper)
        parser = Original(wrapper, ast)
        parser.parse('.', conf)
        ast.walk()

        assert len(wrapper.roots) == 1
        assert wrapper.roots[0].key_with_class() == "pattern:*.md|jinja"