Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed May 5, 2024
1 parent 08dc96c commit 7e15526
Showing 1 changed file with 43 additions and 17 deletions.
60 changes: 43 additions & 17 deletions tests/test_op_sql_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,33 @@ async def test__sql_with_param(self):
async def test__sql_with_param_cols(self):
res = await self.conn.execute("select 1 as a, 2 as b where 1 = ?", [1])

self.assertResponseEqualKV(res, [{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}], "Body ok")
self.assertResponseEqualKV(
res,
[
{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}
],
"Body ok",
)

@ensure_version(min=(2, 0))
async def test__sql_with_param_cols2(self):
res = await self.conn.execute(
"select 1 as a, 2 as b where 1 = ? and 2 = ?", [1, 2]
)

self.assertResponseEqualKV(res, [{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}], "Body ok")
self.assertResponseEqualKV(
res,
[
{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}
],
"Body ok",
)

@ensure_version(min=(2, 0))
async def test__sql_with_param_cols_maps(self):
Expand All @@ -55,10 +67,16 @@ async def test__sql_with_param_cols_maps(self):
],
)

self.assertResponseEqualKV(res, [{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}], "Body ok")
self.assertResponseEqualKV(
res,
[
{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}
],
"Body ok",
)

@ensure_version(min=(2, 0))
async def test__sql_with_param_cols_maps_and_positional(self):
Expand All @@ -67,10 +85,16 @@ async def test__sql_with_param_cols_maps_and_positional(self):
[{":p1": 1}, {":p2": 2}, 3, 4],
)

self.assertResponseEqualKV(res, [{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}], "Body ok")
self.assertResponseEqualKV(
res,
[
{
self._compat_field_name("a"): 1,
self._compat_field_name("b"): 2,
}
],
"Body ok",
)

@ensure_version(min=(2, 0))
async def test__sql_insert(self):
Expand Down Expand Up @@ -230,7 +254,9 @@ async def test__sql_select_full_metadata(self):
self.assertEqual(None, res.metadata.fields[1].is_autoincrement)
self.assertIsNone(res.metadata.fields[0].collation)

self.assertEqual(self._compat_field_name("name"), res.metadata.fields[1].name)
self.assertEqual(
self._compat_field_name("name"), res.metadata.fields[1].name
)
self.assertEqual("string", res.metadata.fields[1].type)
self.assertEqual(True, res.metadata.fields[1].is_nullable)
self.assertEqual(None, res.metadata.fields[1].is_autoincrement)
Expand Down

0 comments on commit 7e15526

Please sign in to comment.