Server IP : 92.204.138.22 / Your IP : 18.218.181.182 Web Server : Apache System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64 User : internationaljou ( 1019) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/panopta-agent/dependencies/simplejson/tests/ |
Upload File : |
from unittest import TestCase import simplejson from simplejson.compat import text_type # Tests for issue demonstrated in https://github.com/simplejson/simplejson/issues/144 class WonkyTextSubclass(text_type): def __getslice__(self, start, end): return self.__class__('not what you wanted!') class TestStrSubclass(TestCase): def test_dump_load(self): for s in ['', '"hello"', 'text', u'\u005c']: self.assertEqual( s, simplejson.loads(simplejson.dumps(WonkyTextSubclass(s)))) self.assertEqual( s, simplejson.loads(simplejson.dumps(WonkyTextSubclass(s), ensure_ascii=False)))