Ejemplo n.º 1
0
    def test_invalid_unicode_characters_in_ssl_options(self):
        with self.assertLogs() as log:
            nparser = parser.NginxParser(self.config_path)
            path = nparser.abs_path('invalid_unicode_comments.conf')
            parsed = parser._parse_ssl_options(path)  # pylint: disable=protected-access

        self.assertEqual([], parsed)
        self.assertTrue(
            any(('invalid character' in output) and ('UTF-8' in output)
                for output in log.output))
Ejemplo n.º 2
0
 def test_valid_unicode_characters_in_ssl_options(self):
     nparser = parser.NginxParser(self.config_path)
     path = nparser.abs_path('valid_unicode_comments.conf')
     parsed = parser._parse_ssl_options(path)  # pylint: disable=protected-access
     self.assertEqual(['server'], parsed[2][0])
     self.assertEqual(['listen', '80'], parsed[2][1][3])