Current Path : /usr/lib/python2.7/dist-packages/simplejson/tests/ |
Current File : //usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyc |
ƄNc @ s6 d d l m Z d d l Z d e f d YZ d S( i( t TestCaseNt TestUnicodec B s e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z RS( c C sY t j d d } d } | j d } | j | } | j | } | j | | d S( Nt encodings utf-8u αΩ( t jsont JSONEncodert encodet assertEquals( t selft encodert ut st jut js( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding1 s c C sS d } | j d } t j | d d } t j | d d } | j | | d S( Nu αΩs utf-8R ( R R t dumpsR ( R R R R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding2 s c C s) d } t j | } | j | d d S( Nu αΩs "\u03b1\u03a9"( R R R ( R R t j( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding3 s c C s, d } t j | g } | j | d d S( Nu αΩs ["\u03b1\u03a9"]( R R R ( R R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding4 s c C s7 d } t j | d t } | j | d | d d S( Nu αΩt ensure_asciiu "( R R t FalseR ( R R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding5 s c C s: d } t j | g d t } | j | d | d d S( Nu αΩR u ["u "]( R R R R ( R R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_encoding6$ s c C sB d } | j t j | d | j t j | d t d d S( Nu 𝄠s "\ud834\udd20"R u "𝄠"( R R R R ( R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_big_unicode_encode) s c C sD d } | j t j d | d | | j t j d | d S( Nu z𝄠xt "s "z\ud834\udd20x"( R R t loads( R R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_big_unicode_decode. s !c C sP xI t d d D]8 } t | } d | f } | j t j | | q Wd S( Ni i s "\u%04x"( t ranget unichrR R R ( R t iR R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_unicode_decode3 s c C s d } d d d d d d d g } | j t j | t | | j t j | d d | t j | d t j } | j | t j | | j t | t j | j t j | d t j d d t j | d S( Nu? {"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}u xkdi u kcwi u arti u hxmi u qrti u padi u hoyi t object_pairs_hookc S s | S( N( ( t x( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt <lambda>? s t object_hookc S s d S( N( t None( R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyR! F s ( u xkdi ( u kcwi ( u arti ( u hxmi ( u qrti ( u padi ( u hoyi ( t assertEqualR R t evalt OrderedDictt type( R R t pt od( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt# test_object_pairs_hook_with_unicode: s " c C s- | j t j d j d i d d 6 d S( Nu {"a": "é"}s utf-8u ét a( R R R R ( R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_default_encodingJ s c C se | j t t j d t | j t t j d t | j t t j d d t d S( Nu ""u "a"u ["a"]i ( R R' R R t unicode( R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt test_unicode_preservationN s c C s | j t t j g d t t | j t t j d d t t | j t t j i d t t | j t t j d d t t d S( NR i t ( R R' R R R R- ( R ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt' test_ensure_ascii_false_returns_unicodeS s %%%c C s i d d 6} i d d 6} d } d } | j t j | | | j t j | | | j t j | d t | | j t j | d t | d S( Ns Arrêt sur imagesu quuxu Arrêt sur imagess! {"quux": "Arr\u00eat sur images"}u {"quux": "Arrêt sur images"}R ( R R R R ( R t doc1t doc2t doc_asciit doc_unicode( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt+ test_ensure_ascii_false_bytestring_encodingZ s c C s d } | j d } d } | j t j | | | j t j | | | j t j | d t | | j t j | d t | d S( Nu t utf8s "\u2029\u2028"R ( R R R R R ( R t s1t s2t expect( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt$ test_ensure_ascii_linebreak_encodinge s ( t __name__t __module__R R R R R R R R R R* R, R. R0 R5 R: ( ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyR s ( t unittestR t simplejsonR R ( ( ( sA /usr/lib/python2.7/dist-packages/simplejson/tests/test_unicode.pyt <module> s