From f477edcd10b9a785e33133421e285c7fc700076c Mon Sep 17 00:00:00 2001 From: Eugine Blikh <bigbes@gmail.com> Date: Mon, 16 Sep 2013 18:18:03 +0400 Subject: [PATCH] Remove spaces in errmsg and rename tarantool-python import checking function --- test/big/sql.result | 12 ++++++------ test/box/bad_trigger.result | 4 ++-- test/box/lua.result | 36 ++++++++++++++++++------------------ test/box/sql.result | 20 ++++++++++---------- test/lib/box_connection.py | 15 ++------------- test/lib/sql_ast.py | 8 ++++---- test/lib/tarantool_server.py | 4 ++-- test/lib/test_suite.py | 2 +- 8 files changed, 45 insertions(+), 56 deletions(-) diff --git a/test/big/sql.result b/test/big/sql.result index cc3d549dc5..1a29374414 100644 --- a/test/big/sql.result +++ b/test/big/sql.result @@ -65,8 +65,8 @@ box.space[0]:truncate() insert into t0 values ('Britney') --- - error: - errcode : ER_INDEX_ARITY - errmsg : Tuple field count 1 is less than required by a defined index (expected 2) + errcode: ER_INDEX_ARITY + errmsg: Tuple field count 1 is less than required by a defined index (expected 2) ... select * from t0 where k1='Anything' --- @@ -74,8 +74,8 @@ select * from t0 where k1='Anything' insert into t0 values ('Stephanie') --- - error: - errcode : ER_INDEX_ARITY - errmsg : Tuple field count 1 is less than required by a defined index (expected 2) + errcode: ER_INDEX_ARITY + errmsg: Tuple field count 1 is less than required by a defined index (expected 2) ... select * from t0 where k1='Anything' --- @@ -390,8 +390,8 @@ select * from t0 where k1='Britney' replace into t0 values ('Spears') --- - error: - errcode : ER_INDEX_ARITY - errmsg : Tuple field count 1 is less than required by a defined index (expected 2) + errcode: ER_INDEX_ARITY + errmsg: Tuple field count 1 is less than required by a defined index (expected 2) ... select * from t0 where k0='Spears' --- diff --git a/test/box/bad_trigger.result b/test/box/bad_trigger.result index aff0dff60d..83c63de72c 100644 --- a/test/box/bad_trigger.result +++ b/test/box/bad_trigger.result @@ -10,8 +10,8 @@ type(box.session.on_connect(function() nosuchfunction() end)) select * from t0 where k0=0 --- - error: - errcode : ER_PROC_LUA - errmsg : Lua error: [string "return type(box.session.on_connect(function()..."]:1: attempt to call global 'nosuchfunction' (a nil value) + errcode: ER_PROC_LUA + errmsg: Lua error: [string "return type(box.session.on_connect(function()..."]:1: attempt to call global 'nosuchfunction' (a nil value) ... Connection is dead. diff --git a/test/box/lua.result b/test/box/lua.result index a800a5692c..85d52d7666 100644 --- a/test/box/lua.result +++ b/test/box/lua.result @@ -210,14 +210,14 @@ box.process(22, box.pack('iii', 0, 0, 0)) call box.process('abc', 'def') --- - error: - errcode : ER_ILLEGAL_PARAMS - errmsg : Illegal parameters, unsupported command code, check the error log + errcode: ER_ILLEGAL_PARAMS + errmsg: Illegal parameters, unsupported command code, check the error log ... call box.pack('test') --- - error: - errcode : ER_PROC_LUA - errmsg : Lua error: box.pack: argument count does not match the format + errcode: ER_PROC_LUA + errmsg: Lua error: box.pack: argument count does not match the format ... call box.pack('p', 'this string is 45 characters long 1234567890 ') --- @@ -256,8 +256,8 @@ f1=nil call f1() --- - error: - errcode : ER_NO_SUCH_PROC - errmsg : Procedure 'f1' is not defined + errcode: ER_NO_SUCH_PROC + errmsg: Procedure 'f1' is not defined ... function f1() return f1 end --- @@ -265,8 +265,8 @@ function f1() return f1 end call f1() --- - error: - errcode : ER_PROC_RET - errmsg : Return type 'function' is not supported in the binary protocol + errcode: ER_PROC_RET + errmsg: Return type 'function' is not supported in the binary protocol ... insert into t0 values (1, 'test box delete') --- @@ -381,8 +381,8 @@ call box.insert('0', 'test', 'old', 'abcd') call box.insert('0', 'test', 'old', 'abcd') --- - error: - errcode : ER_TUPLE_FOUND - errmsg : Duplicate key exists in unique index 0 + errcode: ER_TUPLE_FOUND + errmsg: Duplicate key exists in unique index 0 ... call box.update('0', 'test', '=p=p', '����', 'pass', 1, 'new') --- @@ -1030,8 +1030,8 @@ function f3() return {'hello', {'world'}} end call f3() --- - error: - errcode : ER_PROC_RET - errmsg : Return type 'table' is not supported in the binary protocol + errcode: ER_PROC_RET + errmsg: Return type 'table' is not supported in the binary protocol ... function f3() return 'hello', {{'world'}, {'canada'}} end --- @@ -1039,8 +1039,8 @@ function f3() return 'hello', {{'world'}, {'canada'}} end call f3() --- - error: - errcode : ER_PROC_RET - errmsg : Return type 'table' is not supported in the binary protocol + errcode: ER_PROC_RET + errmsg: Return type 'table' is not supported in the binary protocol ... function f3() return {}, '123', {{}, {}} end --- @@ -1048,8 +1048,8 @@ function f3() return {}, '123', {{}, {}} end call f3() --- - error: - errcode : ER_PROC_RET - errmsg : Return type 'table' is not supported in the binary protocol + errcode: ER_PROC_RET + errmsg: Return type 'table' is not supported in the binary protocol ... function f3() return { {{'hello'}} } end --- @@ -1057,8 +1057,8 @@ function f3() return { {{'hello'}} } end call f3() --- - error: - errcode : ER_PROC_RET - errmsg : Return type 'table' is not supported in the binary protocol + errcode: ER_PROC_RET + errmsg: Return type 'table' is not supported in the binary protocol ... function f3() return { box.tuple.new('hello'), {'world'} } end --- diff --git a/test/box/sql.result b/test/box/sql.result index fb8fb83278..dd5d9a7960 100644 --- a/test/box/sql.result +++ b/test/box/sql.result @@ -11,8 +11,8 @@ ping select * from t0 --- - error: - errcode : ER_EXACT_MATCH - errmsg : Invalid key part count in an exact match (expected 1, got 0) + errcode: ER_EXACT_MATCH + errmsg: Invalid key part count in an exact match (expected 1, got 0) ... insert into t0 values (1, 'I am a tuple') --- @@ -84,8 +84,8 @@ select * from t0 where k0 = 1 update t0 set k1 = 'Huh', k1000 = 'invalid field' where k0=1 --- - error: - errcode : ER_NO_SUCH_FIELD - errmsg : Field 1000 was not found in the tuple + errcode: ER_NO_SUCH_FIELD + errmsg: Field 1000 was not found in the tuple ... select * from t0 where k0 = 1 --- @@ -152,20 +152,20 @@ delete from t0 where k0=4294967295 select * from t1 where k0 = 0 --- - error: - errcode : ER_NO_SUCH_SPACE - errmsg : Space 1 does not exist + errcode: ER_NO_SUCH_SPACE + errmsg: Space 1 does not exist ... select * from t65537 where k0 = 0 --- - error: - errcode : ER_NO_SUCH_SPACE - errmsg : Space 65537 does not exist + errcode: ER_NO_SUCH_SPACE + errmsg: Space 65537 does not exist ... select * from t4294967295 where k0 = 0 --- - error: - errcode : ER_NO_SUCH_SPACE - errmsg : Space 4294967295 does not exist + errcode: ER_NO_SUCH_SPACE + errmsg: Space 4294967295 does not exist ... box.space[0]:drop() --- diff --git a/test/lib/box_connection.py b/test/lib/box_connection.py index 0b8dc491bf..ae379b2fed 100644 --- a/test/lib/box_connection.py +++ b/test/lib/box_connection.py @@ -29,21 +29,10 @@ import socket import struct import warnings -from test_suite import chk_tnt_includes +from test_suite import check_tarantool_import from tarantool_connection import TarantoolConnection -def chk_tnt_includes(): - try: - tnt_py = os.path.dirname(os.path.abspath(__file__)) - tnt_py = os.path.join(tnt_py, 'tarantool-python/src') - if tnt_py not in sys.path: - sys.path = [tnt_py] + sys.path - import tarantool - except ImportError: - sys.stderr.write("\n\nNo tarantool-python library found\n") - sys.exit(1) - -chk_tnt_includes() +check_tarantool_import() from tarantool import Connection as tnt_connection from tarantool import Schema diff --git a/test/lib/sql_ast.py b/test/lib/sql_ast.py index 83b8f1dda4..a8f7f94870 100644 --- a/test/lib/sql_ast.py +++ b/test/lib/sql_ast.py @@ -4,9 +4,9 @@ import sys import ctypes import struct -from lib.test_suite import chk_tnt_includes +from lib.test_suite import check_tarantool_import -chk_tnt_includes() +check_tarantool_import() from tarantool.request import ( RequestPing, RequestInsert, @@ -79,8 +79,8 @@ ER = { errstr = """--- - error: - errcode : {0} - errmsg : {1} + errcode: {0} + errmsg: {1} ...""" def format_error(response): diff --git a/test/lib/tarantool_server.py b/test/lib/tarantool_server.py index 4489c28b98..bb446075ba 100644 --- a/test/lib/tarantool_server.py +++ b/test/lib/tarantool_server.py @@ -17,7 +17,7 @@ import ConfigParser from lib.server import Server from lib.box_connection import BoxConnection -from lib.test_suite import FilteredStream, Test, chk_tnt_includes +from lib.test_suite import FilteredStream, Test, check_tarantool_import from lib.admin_connection import AdminConnection from lib.memcached_connection import MemcachedConnection @@ -26,7 +26,7 @@ try: except ImportError: import StringIO -chk_tnt_includes() +check_tarantool_import() import tarantool def check_port(port): diff --git a/test/lib/test_suite.py b/test/lib/test_suite.py index ce39012dd9..bc019b5c47 100644 --- a/test/lib/test_suite.py +++ b/test/lib/test_suite.py @@ -15,7 +15,7 @@ try: except ImportError: from StringIO import StringIO -def chk_tnt_includes(): +def check_tarantool_import(): try: tnt_py = os.path.dirname(os.path.abspath(__file__)) tnt_py = os.path.join(tnt_py, 'tarantool-python/src') -- GitLab