MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_mogrify_simple

Method test_mogrify_simple

tests/test_utils.py:16–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14class TestUtils(tb.ConnectedTestCase):
15
16 async def test_mogrify_simple(self):
17 cases = [
18 ('timestamp',
19 datetime.datetime(2016, 10, 10),
20 "SELECT '2016-10-10 00:00:00'::timestamp"),
21 ('int[]',
22 [[1, 2], [3, 4]],
23 "SELECT '{{1,2},{3,4}}'::int[]"),
24 ]
25
26 for typename, data, expected in cases:
27 with self.subTest(value=data, type=typename):
28 mogrified = await utils._mogrify(
29 self.con, 'SELECT $1::{}'.format(typename), [data])
30 self.assertEqual(mogrified, expected)
31
32 async def test_mogrify_multiple(self):
33 mogrified = await utils._mogrify(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected