(self)
| 136 | super().tearDown() |
| 137 | |
| 138 | async def test_executemany_basic(self): |
| 139 | result = await self.con.executemany(''' |
| 140 | INSERT INTO exmany VALUES($1, $2) |
| 141 | ''', [ |
| 142 | ('a', 1), ('b', 2), ('c', 3), ('d', 4) |
| 143 | ]) |
| 144 | |
| 145 | self.assertIsNone(result) |
| 146 | |
| 147 | result = await self.con.fetch(''' |
| 148 | SELECT * FROM exmany |
| 149 | ''') |
| 150 | |
| 151 | self.assertEqual(result, [ |
| 152 | ('a', 1), ('b', 2), ('c', 3), ('d', 4) |
| 153 | ]) |
| 154 | |
| 155 | # Empty set |
| 156 | await self.con.executemany(''' |
| 157 | INSERT INTO exmany VALUES($1, $2) |
| 158 | ''', ()) |
| 159 | |
| 160 | result = await self.con.fetch(''' |
| 161 | SELECT * FROM exmany |
| 162 | ''') |
| 163 | |
| 164 | self.assertEqual(result, [ |
| 165 | ('a', 1), ('b', 2), ('c', 3), ('d', 4) |
| 166 | ]) |
| 167 | |
| 168 | async def test_executemany_returning(self): |
| 169 | result = await self.con.fetchmany(''' |
nothing calls this directly
no test coverage detected