mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-09-21 11:18:49 +03:00
- Tabs fixed.
This commit is contained in:
parent
70e555585e
commit
a6ea092acc
|
@ -60,18 +60,18 @@ class TypesBasicTests(TestCase):
|
|||
def testBinary(self):
|
||||
s = ''.join([chr(x) for x in range(256)])
|
||||
b = psycopg2.Binary(s)
|
||||
r = str(self.execute("SELECT %s::bytea AS foo", (b,)))
|
||||
r = str(self.execute("SELECT %s::bytea AS foo", (b,)))
|
||||
self.failUnless(r == s, "wrong binary quoting")
|
||||
# test to make sure an empty Binary is converted to an empty string
|
||||
b = psycopg2.Binary('')
|
||||
self.assertEqual(str(b), "''")
|
||||
|
||||
def testArray(self):
|
||||
s = self.execute("SELECT %s AS foo", ([[1,2],[3,4]],))
|
||||
self.failUnless(s == [[1,2],[3,4]], "wrong array quoting " + str(s))
|
||||
s = self.execute("SELECT %s AS foo", (['one', 'two', 'three'],))
|
||||
self.failUnless(s == ['one', 'two', 'three'],
|
||||
"wrong array quoting " + str(s))
|
||||
s = self.execute("SELECT %s AS foo", ([[1,2],[3,4]],))
|
||||
self.failUnless(s == [[1,2],[3,4]], "wrong array quoting " + str(s))
|
||||
s = self.execute("SELECT %s AS foo", (['one', 'two', 'three'],))
|
||||
self.failUnless(s == ['one', 'two', 'three'],
|
||||
"wrong array quoting " + str(s))
|
||||
|
||||
|
||||
class TypesBasicSuite(TestSuite):
|
||||
|
|
Loading…
Reference in New Issue
Block a user