Skip to content

Commit b335adf

Browse files
Use this
1 parent 3d1eb3e commit b335adf

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

test/suites/test_dml.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def setUpClass(self):
2020
self.srv.script = 'test/suites/box.lua'
2121
self.srv.start()
2222
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')
2324
self.con_encoding_none = tarantool.Connection(self.srv.host, self.srv.args['primary'], encoding=None)
2425
self.adm = self.srv.admin
2526
self.space_created = self.adm("box.schema.create_space('space_1')")
@@ -106,6 +107,7 @@ def test_00_00_authenticate(self):
106107
box.schema.user.grant('test', 'execute,read,write', 'universe')
107108
"""))
108109
self.assertEqual(self.con.authenticate('test', 'test')._data, None)
110+
self.assertEqual(self.con_encoding_utf8.authenticate('test', 'test')._data, None)
109111
self.assertEqual(self.con_encoding_none.authenticate('test', 'test')._data, None)
110112

111113
def test_00_01_space_created(self):
@@ -351,26 +353,32 @@ def test_12_update_fields(self):
351353
[[2, 'help', 7]]
352354
)
353355

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' ])
356361

357-
def test_13_01_string_select_default_behavior(self):
362+
def test_13_01_string_select_encoding_utf8_behavior(self):
358363
self.adm(r"box.space['space_str']:insert{'test_14_string_select_default_behavior'}")
359364

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'])
361366
self.assertIsInstance(resp[0][0], tarantool.utils.string_types)
362367

363368
@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' ])
366374

367375
@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):
369377
self.adm(r"""
370378
bintuple_insert(box.space['space_varbin'], {0xDE, 0xAD, 0xBE, 0xAF, 0x16})
371379
""")
372380

373-
resp = self.con.select('space_varbin', [ bytes(bytearray.fromhex('DEADBEAF16')) ])
381+
resp = self.con_encoding_utf8.select('space_varbin', [ bytes(bytearray.fromhex('DEADBEAF16')) ])
374382
self.assertIsInstance(resp[0][0], tarantool.utils.binary_types)
375383

376384
def test_14_00_string_insert_encoding_none_behavior(self):

0 commit comments

Comments
 (0)