(self)
| 14 | class 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( |
nothing calls this directly
no outgoing calls
no test coverage detected