(self)
| 831 | ) |
| 832 | |
| 833 | def testHookPreOpen(self): |
| 834 | def pre_open(filename, basedir): |
| 835 | return 'blah' in filename, filename, basedir |
| 836 | |
| 837 | options = { |
| 838 | 'plug': { |
| 839 | 'pre_open': pre_open |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | ApacheConfigLexer = make_lexer(**options) |
| 844 | ApacheConfigParser = make_parser(**options) |
| 845 | |
| 846 | loader = ApacheConfigLoader( |
| 847 | ApacheConfigParser(ApacheConfigLexer()), **options) |
| 848 | |
| 849 | config = loader.load('halb.conf') |
| 850 | |
| 851 | self.assertEqual(config, {}) |
| 852 | |
| 853 | self.assertRaises(ApacheConfigError, loader.load, 'blah.conf') |
| 854 | |
| 855 | def testHookPreRead(self): |
| 856 | text = """\ |
nothing calls this directly
no test coverage detected