Exemplo n.º 1
0
 async def test__call_complex_param_bare(self):
     p, cmp = get_complex_param(encoding=self.conn.encoding)
     cmp = [cmp]
     res = await self.conn.call('func_param_bare', [p])
     if not self.has_new_call():
         cmp = [cmp]
     self.assertResponseEqual(res, cmp, 'Body ok')
Exemplo n.º 2
0
    async def test__insert_complex_tuple(self):
        p, p_cmp = get_complex_param(replace_bin=False)
        data = [1, 'hello', 1, 2, p]
        data_cmp = [1, 'hello', 1, 2, p_cmp]

        res = await self.conn.insert(self.TESTER_SPACE_ID, data)
        self.assertResponseEqual(res, [data_cmp], 'Body ok')
Exemplo n.º 3
0
    async def test__select_complex(self):
        p, p_cmp = get_complex_param(replace_bin=False)
        data = [1, 'hello2', 1, 4, p_cmp]

        await self.conn.insert(self.TESTER_SPACE_ID, data)

        res = await self.conn.select(self.TESTER_SPACE_ID)
        self.assertResponseEqual(res, [data], 'Body ok')
Exemplo n.º 4
0
    async def test__read_buffer_reallocate_ok(self):
        await self.tnt_reconnect(initial_read_buffer_size=1)

        p, cmp = get_complex_param(encoding=self.conn.encoding)
        try:
            res = await self.conn.call('func_param', [p])
        except Exception as e:
            self.fail(e)

        self.assertDictEqual(res[0][0], cmp, 'Body ok')
Exemplo n.º 5
0
    async def test__encoding_cp1251(self):
        await self.tnt_reconnect(encoding='cp1251')
        p, p_cmp = get_complex_param(replace_bin=False)

        data = [1, 'hello', 1, 0, p]
        data_cmp = [1, 'hello', 1, 0, p_cmp]

        res = await self.conn.insert(self.TESTER_SPACE_ID, data)
        self.assertResponseEqual(res, [data_cmp], 'Body ok')

        res = await self.conn.select(self.TESTER_SPACE_ID)
        self.assertResponseEqual(res, [data_cmp], 'Body ok')
Exemplo n.º 6
0
 async def test__call_complex_param(self):
     p, cmp = get_complex_param(encoding=self.conn.encoding)
     res = await self.conn.call('func_param', [p])
     self.assertDictEqual(res[0][0], cmp, 'Body ok')
Exemplo n.º 7
0
 async def test__eval_complex_param(self):
     p, cmp = get_complex_param(encoding=self.conn.encoding)
     res = await self.conn.eval('return {...}', [p])
     self.assertDictEqual(res[0][0], cmp, 'Body ok')