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

Method testLoadWholeConfig

tests/unit/test_loader.py:41–71  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 ApacheConfigParser(ApacheConfigLexer()), **options)
40
41 def testLoadWholeConfig(self):
42 text = """\
43
44# a
45a = b
46b = 三
47
48<a block>
49 a = b
50</a>
51a b
52<a a block>
53c "d d"
54</a>
55# a
56"""
57 ApacheConfigLexer = make_lexer()
58 ApacheConfigParser = make_parser()
59
60 loader = ApacheConfigLoader(
61 ApacheConfigParser(ApacheConfigLexer()))
62
63 config = loader.loads(text)
64
65 self.assertEqual(
66 config, {
67 'b': '三',
68 'a': ['b', {'block': {'a': 'b'}}, 'b',
69 {'a block': {'c': 'd d'}}]
70 }
71 )
72
73 def testDumpWholeConfig(self):
74 text = """\

Callers

nothing calls this directly

Calls 4

loadsMethod · 0.95
make_lexerFunction · 0.90
make_parserFunction · 0.90
ApacheConfigLoaderClass · 0.90

Tested by

no test coverage detected