aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/tests/test_ssqls.py
blob: 2a1d0321092dc28ad2f692f9817a6ea722fd7e65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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']