mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:14:54 +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])
|
self.assertEqual(['listen', '80'], parsed[0][2][1][3])
|
||||||
|
|
||||||
def test_invalid_unicode_characters(self):
|
def test_invalid_unicode_characters(self):
|
||||||
nparser = parser.NginxParser(self.config_path)
|
with self.assertLogs() as log:
|
||||||
# pylint: disable=protected-access
|
nparser = parser.NginxParser(self.config_path)
|
||||||
path = nparser.abs_path('invalid_unicode_comments.conf')
|
path = nparser.abs_path('invalid_unicode_comments.conf')
|
||||||
parsed = nparser._parse_files(path)
|
parsed = nparser._parse_files(path) # pylint: disable=protected-access
|
||||||
|
|
||||||
self.assertEqual([], parsed)
|
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):
|
def test_valid_unicode_characters_in_ssl_options(self):
|
||||||
nparser = parser.NginxParser(self.config_path)
|
nparser = parser.NginxParser(self.config_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user