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

Method testBlockWithOptions

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

Source from the content-addressed store, hash-verified

213 )
214
215 def testBlockWithOptions(self):
216 text = """\
217<a>
218 #a
219 a = "b b"
220 # a b
221 a = "b b"
222</a>"""
223 ApacheConfigLexer = make_lexer()
224 ApacheConfigParser = make_parser()
225
226 parser = ApacheConfigParser(
227 ApacheConfigLexer(), start='block')
228
229 ast = parser.parse(text)
230 self.assertEqual(
231 ast, [
232 'block', ('a',),
233 ['contents',
234 ['comment', '#a'],
235 ['statement', 'a', 'b b'],
236 ['comment', '# a b'],
237 ['statement', 'a', 'b b']], 'a'
238 ]
239 )
240
241 def testNestedBlock(self):
242 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