@@ -21,9 +21,9 @@ def generateString(length, alphabet=string.ascii_letters + string.digits + strin
2121datau = data .astype ('U' )
2222datac = stringtochar (data , encoding = 'ascii' )
2323
24- nx , n_strlen = 3 , 10
25- unicode_strings = np .array (['Münster' , 'London ' , 'Amsterdam ' ],dtype = 'U' + str (n_strlen ))
26- unicode_strings2 = np .array (['Münster' , 'Liége ' , 'Amsterdam ' ],dtype = 'U' + str (n_strlen ))
24+ nx , n_strlen = 3 , 12
25+ unicode_strings = np .array (['Münster' , 'Liége ' , '東京 ' ],dtype = 'U' + str (n_strlen ))
26+ unicode_strings2 = np .array (['Münster' , 'Москва ' , '東京 ' ],dtype = 'U' + str (n_strlen ))
2727
2828class StringArrayTestCase (unittest .TestCase ):
2929
@@ -55,7 +55,7 @@ def setUp(self):
5555 v4 = nc .createVariable ("strings4" , "S1" , dimensions = ("x" , "nstr" ,))
5656 v4 ._Encoding = "UTF-8"
5757 v4 [:] = unicode_strings
58- v4 [1 ] = "Liége "
58+ v4 [1 ] = "Москва "
5959 nc .close ()
6060
6161 def tearDown (self ):
@@ -70,6 +70,7 @@ def runTest(self):
7070 v2 = nc .variables ['strings2' ]
7171 v3 = nc .variables ['strings3' ]
7272 v4 = nc .variables ['strings4' ]
73+ print (v4 [:])
7374 assert np .all (v4 [:]== unicode_strings2 )
7475 assert v .dtype .str [1 :] in ['S1' ,'U1' ]
7576 assert v .shape == (nrecs ,n2 ,nchar )
0 commit comments