mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Accept overflow errors testing for LO64 funcs
It is raised on 32 bits by PyArg_ParseTuple. We may work around on truncate (maybe parsing a py_ssize_t) but we would have the same problem on seek as the offset is signed.
This commit is contained in:
parent
7ce7fef322
commit
e490e3bfa3
|
@ -488,14 +488,14 @@ class LargeObjectNot64Tests(LargeObjectTestCase):
|
|||
lo = self.conn.lobject()
|
||||
offset = 1 << 32 # 4gb
|
||||
self.assertRaises(
|
||||
(psycopg2.InterfaceError, psycopg2.NotSupportedError),
|
||||
(OverflowError, psycopg2.InterfaceError, psycopg2.NotSupportedError),
|
||||
lo.seek, offset, 0)
|
||||
|
||||
def test_truncate_larger_than_2gb(self):
|
||||
lo = self.conn.lobject()
|
||||
length = 1 << 32 # 4gb
|
||||
self.assertRaises(
|
||||
(psycopg2.InterfaceError, psycopg2.NotSupportedError),
|
||||
(OverflowError, psycopg2.InterfaceError, psycopg2.NotSupportedError),
|
||||
lo.truncate, length)
|
||||
|
||||
decorate_all_tests(LargeObjectNot64Tests,
|
||||
|
|
Loading…
Reference in New Issue
Block a user