Skip to content

Commit

Permalink
fix 1.10 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed May 5, 2024
1 parent 43bd39c commit 7beeb29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_op_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from asynctnt import Response
from asynctnt.exceptions import ErrorCode, TarantoolDatabaseError, TarantoolSchemaError
from tests import BaseTarantoolTestCase
from tests._testbase import ensure_version


class UpdateTestCase(BaseTarantoolTestCase):
Expand Down Expand Up @@ -42,6 +43,7 @@ async def test__update_one_assign(self):
data[1][2] = 2
self.assertResponseEqual(res, [data[1]], "Body ok")

@ensure_version(min=(2, 3))
async def test__update_one_assign_by_field_name_with_no_schema(self):
data = await self._fill_data()

Expand All @@ -51,6 +53,7 @@ async def test__update_one_assign_by_field_name_with_no_schema(self):
data[4][3] = 100
self.assertResponseEqual(res, [data[4]], "Body ok")

@ensure_version(min=(2, 3))
async def test__update_one_assign_by_json(self):
data = await self._fill_data()

Expand Down Expand Up @@ -81,6 +84,7 @@ async def test__update_one_plus(self):
data[1][2] += 3
self.assertResponseEqual(res, [data[1]], "Body ok")

@ensure_version(min=(2, 3))
async def test__update_one_plus_decimal(self):
data = await self._fill_data()

Expand All @@ -96,6 +100,7 @@ async def test__update_one_plus_str_field(self):
data[1][2] += 3
self.assertResponseEqual(res, [data[1]], "Body ok")

@ensure_version(min=(2, 3))
async def test__update_one_plus_str_field_unknown(self):
await self._fill_data()

Expand Down Expand Up @@ -182,6 +187,7 @@ async def test__update_one_bxor(self):
data[1][2] ^= 0
self.assertResponseEqual(res, [data[1]], "Body ok")

@ensure_version(min=(2, 3))
async def test__update_operations_not_int_without_schema(self):
await self.tnt_reconnect(fetch_schema=False)

Expand Down Expand Up @@ -257,9 +263,9 @@ async def test__update_splice_wrong_args(self):

with self.assertRaises(TarantoolDatabaseError) as exc:
await self.conn.update(self.TESTER_SPACE_ID, [1], [("+", 2, {})])
self.assertEqual(
self.assertRegex(
exc.exception.message,
"Argument type in operation '+' on field 3 does not match field type: expected a number",
r"Argument type in operation '\+' on field \d does not match field type: expected a number",
)

async def test__update_multiple_operations(self):
Expand Down

0 comments on commit 7beeb29

Please sign in to comment.