Test encoding/decoding using a custom codec on a domain.
(self)
| 1364 | ''') |
| 1365 | |
| 1366 | async def test_custom_codec_on_domain(self): |
| 1367 | """Test encoding/decoding using a custom codec on a domain.""" |
| 1368 | await self.con.execute(''' |
| 1369 | CREATE DOMAIN custom_codec_t AS int |
| 1370 | ''') |
| 1371 | |
| 1372 | try: |
| 1373 | with self.assertRaisesRegex( |
| 1374 | asyncpg.UnsupportedClientFeatureError, |
| 1375 | 'custom codecs on domain types are not supported' |
| 1376 | ): |
| 1377 | await self.con.set_type_codec( |
| 1378 | 'custom_codec_t', |
| 1379 | encoder=lambda v: str(v), |
| 1380 | decoder=lambda v: int(v)) |
| 1381 | finally: |
| 1382 | await self.con.execute('DROP DOMAIN custom_codec_t') |
| 1383 | |
| 1384 | async def test_custom_codec_on_stdsql_types(self): |
| 1385 | types = [ |
nothing calls this directly
no test coverage detected