mirror of
https://github.com/certbot/certbot.git
synced 2026-07-31 18:45:40 +02:00
Add logging test for _parse_files()
This commit is contained in:
@@ -491,11 +491,17 @@ class NginxParserTest(util.NginxTest):
|
||||
self.assertEqual(['listen', '80'], parsed[0][2][1][3])
|
||||
|
||||
def test_invalid_unicode_characters(self):
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
# pylint: disable=protected-access
|
||||
path = nparser.abs_path('invalid_unicode_comments.conf')
|
||||
parsed = nparser._parse_files(path)
|
||||
with self.assertLogs() as log:
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
path = nparser.abs_path('invalid_unicode_comments.conf')
|
||||
parsed = nparser._parse_files(path) # pylint: disable=protected-access
|
||||
|
||||
self.assertEqual([], parsed)
|
||||
self.assertTrue([
|
||||
True
|
||||
for output in log.output
|
||||
if ('invalid character' in output) and ('UTF-8' in output)
|
||||
])
|
||||
|
||||
def test_valid_unicode_characters_in_ssl_options(self):
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
|
||||
Reference in New Issue
Block a user