MCPcopy Create free account
hub / github.com/etingof/apacheconfig / testNestedBlock

Method testNestedBlock

tests/unit/test_parser.py:241–264  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

239 )
240
241 def testNestedBlock(self):
242 text = """\
243<a>
244 <b>
245 <c>
246 </c>
247 </b>
248</a>"""
249 ApacheConfigLexer = make_lexer()
250 ApacheConfigParser = make_parser()
251
252 parser = ApacheConfigParser(
253 ApacheConfigLexer(), start='block')
254
255 ast = parser.parse(text)
256 self.assertEqual(
257 ast, [
258 'block', ('a',),
259 ['contents',
260 ['block', ('b',),
261 ['contents',
262 ['block', ('c',), [], 'c']], 'b']], 'a'
263 ]
264 )
265
266 def testEmptyBlocks(self):
267 text = """\

Callers

nothing calls this directly

Calls 3

make_lexerFunction · 0.90
make_parserFunction · 0.90
parseMethod · 0.45

Tested by

no test coverage detected