summaryrefslogtreecommitdiff
path: root/reconfigure/tests/parsers/nginx_tests.py
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:26 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 15:58:26 +0200
commitff1408420159488a106492ccd11dd234967029b6 (patch)
tree473420cee1c5229a427ec4cafead1aa6c0a26800 /reconfigure/tests/parsers/nginx_tests.py
Imported Upstream version 0.1.29
Diffstat (limited to 'reconfigure/tests/parsers/nginx_tests.py')
-rw-r--r--reconfigure/tests/parsers/nginx_tests.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/reconfigure/tests/parsers/nginx_tests.py b/reconfigure/tests/parsers/nginx_tests.py
new file mode 100644
index 0000000..83fe8b2
--- /dev/null
+++ b/reconfigure/tests/parsers/nginx_tests.py
@@ -0,0 +1,38 @@
+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