mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Update cherrpy to 17.4.2
This commit is contained in:
parent
f28e741ad7
commit
4d6279a626
131 changed files with 15864 additions and 10389 deletions
34
lib/cherrypy/test/test_compat.py
Normal file
34
lib/cherrypy/test/test_compat.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
"""Test Python 2/3 compatibility module."""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import pytest
|
||||
import six
|
||||
|
||||
from cherrypy import _cpcompat as compat
|
||||
|
||||
|
||||
class StringTester(unittest.TestCase):
|
||||
"""Tests for string conversion."""
|
||||
|
||||
@pytest.mark.skipif(six.PY3, reason='Only useful on Python 2')
|
||||
def test_ntob_non_native(self):
|
||||
"""ntob should raise an Exception on unicode.
|
||||
|
||||
(Python 2 only)
|
||||
|
||||
See #1132 for discussion.
|
||||
"""
|
||||
self.assertRaises(TypeError, compat.ntob, 'fight')
|
||||
|
||||
|
||||
class EscapeTester(unittest.TestCase):
|
||||
"""Class to test escape_html function from _cpcompat."""
|
||||
|
||||
def test_escape_quote(self):
|
||||
"""test_escape_quote - Verify the output for &<>"' chars."""
|
||||
self.assertEqual(
|
||||
"""xx&<>"aa'""",
|
||||
compat.escape_html("""xx&<>"aa'"""),
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue