(self)
| 39 | ApacheConfigParser(ApacheConfigLexer()), **options) |
| 40 | |
| 41 | def testLoadWholeConfig(self): |
| 42 | text = """\ |
| 43 | |
| 44 | # a |
| 45 | a = b |
| 46 | b = 三 |
| 47 | |
| 48 | <a block> |
| 49 | a = b |
| 50 | </a> |
| 51 | a b |
| 52 | <a a block> |
| 53 | c "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 = """\ |
nothing calls this directly
no test coverage detected