Skip to content

Commit c4d4413

Browse files
committed
Minor fixes in tests.tarantool.RequestSelect
1 parent 3c3f0e1 commit c4d4413

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tests/tarantool/request.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,34 @@ def test__cast_to_bytes(self):
5858
# select * from t1 where k0 = 1
5959
self.assertEqual(
6060
bytes(tarantool.request.RequestSelect(1, 0, [(1,)], 0, 0xffff)),
61-
binascii.unhexlify("110000001d00000000000000010000000000000000000000ffff000001000000010000000401000000")
61+
binascii.unhexlify("110000001d00000000000000010000000000000000000000ffff000001000000010000000401000000"),
62+
"Select using integer key"
6263
)
6364

6465
# select * from t1 where k0 = "AAA"
6566
self.assertEqual(
6667
bytes(tarantool.request.RequestSelect(1, 0, [(b"AAA",)], 0, 0xffff)),
67-
binascii.unhexlify("110000001c00000000000000010000000000000000000000ffff0000010000000100000003414141")
68+
binascii.unhexlify("110000001c00000000000000010000000000000000000000ffff0000010000000100000003414141"),
69+
"Select using string key"
6870
)
6971

7072
# select * from t1 where k0 in (1, 2, 3)
7173
self.assertEqual(
7274
bytes(tarantool.request.RequestSelect(1, 0, [(1,), (2,), (3,)], 0, 0xffff)),
73-
binascii.unhexlify("110000002f00000000000000010000000000000000000000ffff000003000000010000000401000000010000000402000000010000000403000000")
75+
binascii.unhexlify("110000002f00000000000000010000000000000000000000ffff000003000000010000000401000000010000000402000000010000000403000000"),
76+
"Select multiple keys"
77+
)
78+
79+
# select * from t1 where k0 = (1, 2)
80+
self.assertEqual(
81+
bytes(tarantool.request.RequestSelect(1, 0, [(1, 2)], 0, 0xffff)),
82+
binascii.unhexlify("110000002200000000000000010000000000000000000000ffff0000010000000200000004010000000402000000"),
83+
"Select using composite index"
84+
)
85+
86+
# select * from t1 where k0 = (1, 2) or k0 = (3, 4)
87+
self.assertEqual(
88+
bytes(tarantool.request.RequestSelect(1, 0, [(1, 2), (3, 4)], 0, 0xffff)),
89+
binascii.unhexlify("110000003000000000000000010000000000000000000000ffff00000200000002000000040100000004020000000200000004030000000404000000"),
90+
"Select multiple keys using composite index"
7491
)

0 commit comments

Comments
 (0)