File: nginx_tests.py

package info (click to toggle)
python-reconfigure 0.1.74%2Bgit49a20890-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 724 kB
  • ctags: 701
  • sloc: python: 4,201; makefile: 186; sh: 7
file content (36 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from reconfigure.tests.parsers.base_test import BaseParserTest
from reconfigure.parsers import NginxParser
from reconfigure.nodes import *


class NginxParserTest (BaseParserTest):
    parser = NginxParser()
    source = """p1 asd;

sec {
    s1p1 asd;
    s1p2 wqe;

    # test
    sec2 test { s2p1 qwe; }
}
"""
    parsed = RootNode(
        None,
        PropertyNode('p1', 'asd'),
        Node(
            'sec',
            PropertyNode('s1p1', 'asd'),
            PropertyNode('s1p2', 'wqe'),
            Node(
                'sec2',
                PropertyNode('s2p1', 'qwe'),
                parameter='test',
                comment='test',
            ),
            parameter=None,
        )
    )


del BaseParserTest