Test encoding/decoding using a custom codec on a domain.
(self)
| 1318 | ''') |
| 1319 | |
| 1320 | async def test_custom_codec_on_domain(self): |
| 1321 | """Test encoding/decoding using a custom codec on a domain.""" |
| 1322 | await self.con.execute(''' |
| 1323 | CREATE DOMAIN custom_codec_t AS int |
| 1324 | ''') |
| 1325 | |
| 1326 | try: |
| 1327 | with self.assertRaisesRegex( |
| 1328 | asyncpg.UnsupportedClientFeatureError, |
| 1329 | 'custom codecs on domain types are not supported' |
| 1330 | ): |
| 1331 | await self.con.set_type_codec( |
| 1332 | 'custom_codec_t', |
| 1333 | encoder=lambda v: str(v), |
| 1334 | decoder=lambda v: int(v)) |
| 1335 | finally: |
| 1336 | await self.con.execute('DROP DOMAIN custom_codec_t') |
| 1337 | |
| 1338 | async def test_custom_codec_on_stdsql_types(self): |
| 1339 | types = [ |
nothing calls this directly
no test coverage detected