File tree 2 files changed +21
-6
lines changed
2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 4
4
__tmp = os .getcwd ()
5
5
os .chdir (os .path .abspath (os .path .dirname (__file__ )))
6
6
7
- from .test_schema import TestSuite_Schema
7
+ from .test_schema import TestSuite_Schema_UnicodeConnection
8
+ from .test_schema import TestSuite_Schema_BinaryConnection
8
9
from .test_dml import TestSuite_Request
9
10
from .test_protocol import TestSuite_Protocol
10
11
from .test_reconnect import TestSuite_Reconnect
11
12
from .test_mesh import TestSuite_Mesh
12
13
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 )
15
18
16
19
def load_tests (loader , tests , pattern ):
17
20
suite = unittest .TestSuite ()
Original file line number Diff line number Diff line change 7
7
import tarantool
8
8
from .lib .tarantool_server import TarantoolServer
9
9
10
- class TestSuite_Schema (unittest .TestCase ):
10
+ class TestSuite_Schema_Abstract (unittest .TestCase ):
11
+ # Define 'encoding' field in a concrete class.
12
+
11
13
@classmethod
12
14
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 )
14
17
print ('-' * 70 , file = sys .stderr )
15
18
self .srv = TarantoolServer ()
16
19
self .srv .script = 'unit/suites/box.lua'
17
20
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 )
19
23
self .sch = self .con .schema
20
24
21
25
def setUp (self ):
@@ -225,3 +229,11 @@ def tearDownClass(self):
225
229
self .con .close ()
226
230
self .srv .stop ()
227
231
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