aboutsummaryrefslogblamecommitdiffstats
path: root/build/plugins/tests/test_ssqls.py
blob: e5daae3a574da2cb261ab0d087cfeb0bde3fa49c (plain) (tree)


























                                                    
import sys
from build.plugins.tests import fake_ymake

sys.modules['ymake'] = fake_ymake

import xml.etree.cElementTree as ET

from build.plugins import ssqls


example = '''\
<?xml version="1.0" encoding="utf-8"?>
<DbObject>
    <include path="A.ssqls">&lt;a.h&gt;</include>
    <include>"b.h"</include>

    <ancestors>
        <ancestor path="C.ssqls"/>
    </ancestors>
</DbObject>
'''


def test_include_parser():
    doc = ET.fromstring(example)
    xmls, headers = ssqls.SSQLSParser.parse_doc(doc)
    assert headers == ['a.h', 'b.h', 'C.h']
    assert xmls == ['A.ssqls', 'C.ssqls']