9
9
import simplejson as json
10
10
import math
11
11
import platform
12
+ import sys
12
13
import time
13
14
import datetime
14
15
import calendar
21
22
from pandas import DataFrame , Series , Index
22
23
import pandas .util .testing as tm
23
24
25
+
26
+ def _skip_if_python25 ():
27
+ import nose
28
+ major , minor = sys .version_info [:2 ]
29
+ if major == 2 and minor == 5 :
30
+ raise nose .SkipTest
31
+
24
32
class UltraJSONTests (TestCase ):
25
33
def test_encodeDictWithUnicodeKeys (self ):
26
34
input = { u"key1" : u"value1" , u"key1" : u"value1" , u"key1" : u"value1" , u"key1" : u"value1" , u"key1" : u"value1" , u"key1" : u"value1" }
@@ -135,6 +143,7 @@ def test_encodeUnicodeConversion2(self):
135
143
self .assertEquals (dec , json .loads (enc ))
136
144
137
145
def test_encodeUnicodeSurrogatePair (self ):
146
+ _skip_if_python25 ()
138
147
input = "\xf0 \x90 \x8d \x86 "
139
148
enc = ujson .encode (input )
140
149
dec = ujson .decode (enc )
@@ -143,6 +152,7 @@ def test_encodeUnicodeSurrogatePair(self):
143
152
self .assertEquals (dec , json .loads (enc ))
144
153
145
154
def test_encodeUnicode4BytesUTF8 (self ):
155
+ _skip_if_python25 ()
146
156
input = "\xf0 \x91 \x80 \xb0 TRAILINGNORMAL"
147
157
enc = ujson .encode (input )
148
158
dec = ujson .decode (enc )
@@ -151,6 +161,7 @@ def test_encodeUnicode4BytesUTF8(self):
151
161
self .assertEquals (dec , json .loads (enc ))
152
162
153
163
def test_encodeUnicode4BytesUTF8Highest (self ):
164
+ _skip_if_python25 ()
154
165
input = "\xf3 \xbf \xbf \xbf TRAILINGNORMAL"
155
166
enc = ujson .encode (input )
156
167
@@ -270,6 +281,7 @@ def test_datetime_nanosecond_unit(self):
270
281
self .assert_ (roundtrip == stamp .value )
271
282
272
283
def test_encodeToUTF8 (self ):
284
+ _skip_if_python25 ()
273
285
input = "\xe6 \x97 \xa5 \xd1 \x88 "
274
286
enc = ujson .encode (input , ensure_ascii = False )
275
287
dec = ujson .decode (enc )
0 commit comments