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

Method test_oid8

tests/test_codecs.py:569–585  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

567 'core type {} ({}) is unhandled'.format(typename, oid))
568
569 async def test_oid8(self):
570 if self.server_version < (19, 0):
571 self.skipTest('oid8 requires PostgreSQL 19 or later')
572
573 values = [0, 2 ** 32, 2 ** 63, 2 ** 64 - 1, None]
574 result = await self.con.fetchval('SELECT $1::oid8[]', values)
575 self.assertEqual(result, values)
576
577 for value in (-1, 2 ** 64, 2 ** 256):
578 with self.subTest(value=value):
579 with self.assertRaisesRegex(
580 asyncpg.DataError, 'value out of uint64 range'):
581 await self.con.fetchval('SELECT $1::oid8', value)
582
583 # A text fallback would accept this; the integer codec must reject it.
584 with self.assertRaises(asyncpg.DataError):
585 await self.con.fetchval('SELECT $1::oid8', '42')
586
587 async def test_regdatabase(self):
588 if self.server_version < (19, 0):

Callers

nothing calls this directly

Calls 1

fetchvalMethod · 0.45

Tested by

no test coverage detected