File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 44__tmp = os .getcwd ()
55os .chdir (os .path .abspath (os .path .dirname (__file__ )))
66
7- from .test_schema import TestSuite_Schema
7+ from .test_schema import TestSuite_Schema_UnicodeConnection
8+ from .test_schema import TestSuite_Schema_BinaryConnection
89from .test_dml import TestSuite_Request
910from .test_protocol import TestSuite_Protocol
1011from .test_reconnect import TestSuite_Reconnect
1112from .test_mesh import TestSuite_Mesh
1213
13- test_cases = (TestSuite_Schema , TestSuite_Request , TestSuite_Protocol ,
14- TestSuite_Reconnect , TestSuite_Mesh )
14+ test_cases = (TestSuite_Schema_UnicodeConnection ,
15+ TestSuite_Schema_BinaryConnection ,
16+ TestSuite_Request , TestSuite_Protocol , TestSuite_Reconnect ,
17+ TestSuite_Mesh )
1518
1619def load_tests (loader , tests , pattern ):
1720 suite = unittest .TestSuite ()
Original file line number Diff line number Diff line change 77import tarantool
88from .lib .tarantool_server import TarantoolServer
99
10- class TestSuite_Schema (unittest .TestCase ):
10+ class TestSuite_Schema_Abstract (unittest .TestCase ):
11+ # Define 'encoding' field in a concrete class.
12+
1113 @classmethod
1214 def setUpClass (self ):
13- print (' SCHEMA ' .center (70 , '=' ), file = sys .stderr )
15+ params = 'connection.encoding: {}' .format (repr (self .encoding ))
16+ print (' SCHEMA ({}) ' .format (params ).center (70 , '=' ), file = sys .stderr )
1417 print ('-' * 70 , file = sys .stderr )
1518 self .srv = TarantoolServer ()
1619 self .srv .script = 'unit/suites/box.lua'
1720 self .srv .start ()
18- self .con = tarantool .Connection (self .srv .host , self .srv .args ['primary' ])
21+ self .con = tarantool .Connection (self .srv .host , self .srv .args ['primary' ],
22+ encoding = self .encoding )
1923 self .sch = self .con .schema
2024
2125 def setUp (self ):
@@ -225,3 +229,11 @@ def tearDownClass(self):
225229 self .con .close ()
226230 self .srv .stop ()
227231 self .srv .clean ()
232+
233+
234+ class TestSuite_Schema_UnicodeConnection (TestSuite_Schema_Abstract ):
235+ encoding = 'utf-8'
236+
237+
238+ class TestSuite_Schema_BinaryConnection (TestSuite_Schema_Abstract ):
239+ encoding = None
You can’t perform that action at this time.
0 commit comments