mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Regression tests fixes.
This commit is contained in:
parent
75d14dfb6e
commit
2804f9a6a9
|
@ -1,3 +1,7 @@
|
|||
2005-5-27 Federico Di Gregorio, <fog@lana.initd.org>
|
||||
|
||||
* tests/types_basic.py: fixed float and binary tests.
|
||||
|
||||
2005-05-26 Federico Di Gregorio <fog@debian.org>
|
||||
|
||||
* Release 2.0b3.
|
||||
|
|
|
@ -43,13 +43,14 @@ class TypesBasicTests(TestCase):
|
|||
s = self.execute("SELECT %s AS foo", (1971L,))
|
||||
self.failUnless(s == 1971L, "wrong integer quoting: " + str(s))
|
||||
s = self.execute("SELECT %s AS foo", (19.10,))
|
||||
self.failUnless(s == 19.10, "wrong float quoting: " + str(s))
|
||||
self.failUnless(abs(s - 19.10) < 0.001,
|
||||
"wrong float quoting: " + str(s))
|
||||
|
||||
def testBinary(self):
|
||||
s = ''.join([chr(x) for x in range(256)])
|
||||
b = psycopg.Binary(s)
|
||||
self.failUnless(self.execute("SELECT %s::bytea AS foo", (b,)) == s,
|
||||
"wrong binary quoting")
|
||||
r = str(self.execute("SELECT %s::bytea AS foo", (b,)))
|
||||
self.failUnless(r == s, "wrong binary quoting")
|
||||
|
||||
class TypesBasicSuite(TestSuite):
|
||||
"""Build a suite of all tests."""
|
||||
|
|
Loading…
Reference in New Issue
Block a user