コード例 #1
0
 def test_01_greeting_1_6_with_tag(self):
     buf = "Tarantool 1.6.6-232-gcf47324                                   \n" + \
           "AtQnb9SAIaKazZZy9lJKvK3urtbjCEJndhRVbslSPGc=                   \n"
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 6))
     self.assertEqual(greeting.protocol, "Binary")
     self.assertIsNone(greeting.uuid)
     self.assertIsNotNone(greeting.salt)
コード例 #2
0
 def test_02_greeting_1_6_console(self):
     buf = "Tarantool 1.6.6-132-g82f5424 (Lua console)                     \n" + \
           "type 'help' for interactive help                               \n"
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 6))
     self.assertEqual(greeting.protocol, "Lua console")
     self.assertIsNone(greeting.uuid)
     self.assertIsNone(greeting.salt)
コード例 #3
0
 def test_02_greeting_1_6_console(self):
     buf = "Tarantool 1.6.6-132-g82f5424 (Lua console)                     \n" + \
           "type 'help' for interactive help                               \n";
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 6))
     self.assertEqual(greeting.protocol, "Lua console")
     self.assertIsNone(greeting.uuid)
     self.assertIsNone(greeting.salt)
コード例 #4
0
 def test_01_greeting_1_6_with_tag(self):
     buf = "Tarantool 1.6.6-232-gcf47324                                   \n" + \
           "AtQnb9SAIaKazZZy9lJKvK3urtbjCEJndhRVbslSPGc=                   \n";
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 6))
     self.assertEqual(greeting.protocol, "Binary")
     self.assertIsNone(greeting.uuid)
     self.assertIsNotNone(greeting.salt)
コード例 #5
0
 def test_03_greeting_1_6_7(self):
     buf = "Tarantool 1.6.7 (Binary) 52dc2837-8001-48fe-bdce-c493c04599ce  \n" + \
           "Z+2F+VRlyK1nKT82xQtxqEggMtkTK5RtPYf27JryRas=                   \n"
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 7))
     self.assertEqual(greeting.protocol, "Binary")
     self.assertEqual(greeting.uuid,
                      uuid.UUID('52dc2837-8001-48fe-bdce-c493c04599ce'))
     self.assertIsNotNone(greeting.salt)
コード例 #6
0
 def test_03_greeting_1_6_7(self):
     buf = "Tarantool 1.6.7 (Binary) 52dc2837-8001-48fe-bdce-c493c04599ce  \n" + \
           "Z+2F+VRlyK1nKT82xQtxqEggMtkTK5RtPYf27JryRas=                   \n";
     greeting = greeting_decode(buf.encode())
     self.assertEqual(greeting.version_id, version_id(1, 6, 7))
     self.assertEqual(greeting.protocol, "Binary")
     self.assertEqual(greeting.uuid,
                      uuid.UUID('52dc2837-8001-48fe-bdce-c493c04599ce'))
     self.assertIsNotNone(greeting.salt)
コード例 #7
0
 def join(self, server_uuid):
     self._opt_reconnect()
     if self.version_id < version_id(1, 7, 0):
         return self._join_v16(server_uuid)
     return self._join_v17(server_uuid)
コード例 #8
0
 def join(self, server_uuid):
     self._opt_reconnect()
     if self.version_id < version_id(1, 7, 0):
         return self._join_v16(server_uuid)
     return self._join_v17(server_uuid)