@@ -20,6 +20,7 @@ def setUpClass(self):
20
20
self .srv .script = 'test/suites/box.lua'
21
21
self .srv .start ()
22
22
self .con = tarantool .Connection (self .srv .host , self .srv .args ['primary' ])
23
+ self .con_encoding_utf8 = tarantool .Connection (self .srv .host , self .srv .args ['primary' ], encoding = 'utf-8' )
23
24
self .con_encoding_none = tarantool .Connection (self .srv .host , self .srv .args ['primary' ], encoding = None )
24
25
self .adm = self .srv .admin
25
26
self .space_created = self .adm ("box.schema.create_space('space_1')" )
@@ -106,6 +107,7 @@ def test_00_00_authenticate(self):
106
107
box.schema.user.grant('test', 'execute,read,write', 'universe')
107
108
""" ))
108
109
self .assertEqual (self .con .authenticate ('test' , 'test' )._data , None )
110
+ self .assertEqual (self .con_encoding_utf8 .authenticate ('test' , 'test' )._data , None )
109
111
self .assertEqual (self .con_encoding_none .authenticate ('test' , 'test' )._data , None )
110
112
111
113
def test_00_01_space_created (self ):
@@ -351,26 +353,32 @@ def test_12_update_fields(self):
351
353
[[2 , 'help' , 7 ]]
352
354
)
353
355
354
- def test_13_00_string_insert_default_behavior (self ):
355
- self .assertNotRaises (self .con .insert , 'space_str' , [ 'test_13_string_insert_default_behavior' ])
356
+ def test_13_00_string_insert_encoding_utf8_behavior (self ):
357
+ self .assertNotRaises (
358
+ self .con_encoding_utf8 .insert ,
359
+ 'space_str' ,
360
+ [ 'test_13_string_insert_default_behavior' ])
356
361
357
- def test_13_01_string_select_default_behavior (self ):
362
+ def test_13_01_string_select_encoding_utf8_behavior (self ):
358
363
self .adm (r"box.space['space_str']:insert{'test_14_string_select_default_behavior'}" )
359
364
360
- resp = self .con .select ('space_str' , ['test_14_string_select_default_behavior' ])
365
+ resp = self .con_encoding_utf8 .select ('space_str' , ['test_14_string_select_default_behavior' ])
361
366
self .assertIsInstance (resp [0 ][0 ], tarantool .utils .string_types )
362
367
363
368
@skip_or_run_varbinary_test
364
- def test_13_02_varbinary_insert_default_behavior (self ):
365
- self .assertNotRaises (self .con .insert , 'space_varbin' , [ b'test_15_varbinary_insert_default_behavior' ])
369
+ def test_13_02_varbinary_insert_encoding_utf8_behavior (self ):
370
+ self .assertNotRaises (
371
+ self .con_encoding_utf8 .insert ,
372
+ 'space_varbin' ,
373
+ [ b'test_15_varbinary_insert_default_behavior' ])
366
374
367
375
@skip_or_run_varbinary_test
368
- def test_13_03_varbinary_select_default_behavior (self ):
376
+ def test_13_03_varbinary_select_encoding_utf8_behavior (self ):
369
377
self .adm (r"""
370
378
bintuple_insert(box.space['space_varbin'], {0xDE, 0xAD, 0xBE, 0xAF, 0x16})
371
379
""" )
372
380
373
- resp = self .con .select ('space_varbin' , [ bytes (bytearray .fromhex ('DEADBEAF16' )) ])
381
+ resp = self .con_encoding_utf8 .select ('space_varbin' , [ bytes (bytearray .fromhex ('DEADBEAF16' )) ])
374
382
self .assertIsInstance (resp [0 ][0 ], tarantool .utils .binary_types )
375
383
376
384
def test_14_00_string_insert_encoding_none_behavior (self ):
0 commit comments