Skip to content

Commit

Permalink
win64-py34-psycopg2-253
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis committed May 29, 2014
1 parent 9e81d60 commit 4039d98
Show file tree
Hide file tree
Showing 17 changed files with 430 additions and 430 deletions.
Binary file modified psycopg2/_psycopg.pyd
Binary file not shown.
88 changes: 44 additions & 44 deletions psycopg2/tests/dbapi20.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_threadsafety(self):
# Must exist
threadsafety = self.driver.threadsafety
# Must be a valid value
self.failUnless(threadsafety in (0,1,2,3))
self.assertTrue(threadsafety in (0,1,2,3))
except AttributeError:
self.fail("Driver doesn't define threadsafety")

Expand All @@ -180,7 +180,7 @@ def test_paramstyle(self):
# Must exist
paramstyle = self.driver.paramstyle
# Must be a valid value
self.failUnless(paramstyle in (
self.assertTrue(paramstyle in (
'qmark','numeric','named','format','pyformat'
))
except AttributeError:
Expand All @@ -190,31 +190,31 @@ def test_Exceptions(self):
# Make sure required exceptions exist, and are in the
# defined hierarchy.
if sys.version[0] == '3': #under Python 3 StardardError no longer exists
self.failUnless(issubclass(self.driver.Warning,Exception))
self.failUnless(issubclass(self.driver.Error,Exception))
self.assertTrue(issubclass(self.driver.Warning,Exception))
self.assertTrue(issubclass(self.driver.Error,Exception))
else:
self.failUnless(issubclass(self.driver.Warning,Exception))
self.failUnless(issubclass(self.driver.Error,Exception))
self.assertTrue(issubclass(self.driver.Warning,Exception))
self.assertTrue(issubclass(self.driver.Error,Exception))

self.failUnless(
self.assertTrue(
issubclass(self.driver.InterfaceError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.DatabaseError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.OperationalError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.IntegrityError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.InternalError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.ProgrammingError,self.driver.Error)
)
self.failUnless(
self.assertTrue(
issubclass(self.driver.NotSupportedError,self.driver.Error)
)

Expand All @@ -227,15 +227,15 @@ def test_ExceptionsAsConnectionAttributes(self):
# by default.
con = self._connect()
drv = self.driver
self.failUnless(con.Warning is drv.Warning)
self.failUnless(con.Error is drv.Error)
self.failUnless(con.InterfaceError is drv.InterfaceError)
self.failUnless(con.DatabaseError is drv.DatabaseError)
self.failUnless(con.OperationalError is drv.OperationalError)
self.failUnless(con.IntegrityError is drv.IntegrityError)
self.failUnless(con.InternalError is drv.InternalError)
self.failUnless(con.ProgrammingError is drv.ProgrammingError)
self.failUnless(con.NotSupportedError is drv.NotSupportedError)
self.assertTrue(con.Warning is drv.Warning)
self.assertTrue(con.Error is drv.Error)
self.assertTrue(con.InterfaceError is drv.InterfaceError)
self.assertTrue(con.DatabaseError is drv.DatabaseError)
self.assertTrue(con.OperationalError is drv.OperationalError)
self.assertTrue(con.IntegrityError is drv.IntegrityError)
self.assertTrue(con.InternalError is drv.InternalError)
self.assertTrue(con.ProgrammingError is drv.ProgrammingError)
self.assertTrue(con.NotSupportedError is drv.NotSupportedError)


def test_commit(self):
Expand Down Expand Up @@ -327,12 +327,12 @@ def test_rowcount(self):
cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
self.table_prefix
))
self.failUnless(cur.rowcount in (-1,1),
self.assertTrue(cur.rowcount in (-1,1),
'cursor.rowcount should == number or rows inserted, or '
'set to -1 after executing an insert statement'
)
cur.execute("select name from %sbooze" % self.table_prefix)
self.failUnless(cur.rowcount in (-1,1),
self.assertTrue(cur.rowcount in (-1,1),
'cursor.rowcount should == number of rows returned, or '
'set to -1 after executing a select statement'
)
Expand Down Expand Up @@ -397,7 +397,7 @@ def _paraminsert(self,cur):
cur.execute("insert into %sbooze values ('Victoria Bitter')" % (
self.table_prefix
))
self.failUnless(cur.rowcount in (-1,1))
self.assertTrue(cur.rowcount in (-1,1))

if self.driver.paramstyle == 'qmark':
cur.execute(
Expand Down Expand Up @@ -426,7 +426,7 @@ def _paraminsert(self,cur):
)
else:
self.fail('Invalid paramstyle')
self.failUnless(cur.rowcount in (-1,1))
self.assertTrue(cur.rowcount in (-1,1))

cur.execute('select name from %sbooze' % self.table_prefix)
res = cur.fetchall()
Expand Down Expand Up @@ -478,7 +478,7 @@ def test_executemany(self):
)
else:
self.fail('Unknown paramstyle')
self.failUnless(cur.rowcount in (-1,2),
self.assertTrue(cur.rowcount in (-1,2),
'insert using cursor.executemany set cursor.rowcount to '
'incorrect value %r' % cur.rowcount
)
Expand Down Expand Up @@ -513,7 +513,7 @@ def test_fetchone(self):
'cursor.fetchone should return None if a query retrieves '
'no rows'
)
self.failUnless(cur.rowcount in (-1,0))
self.assertTrue(cur.rowcount in (-1,0))

# cursor.fetchone should raise an Error if called after
# executing a query that cannot return rows
Expand All @@ -533,7 +533,7 @@ def test_fetchone(self):
self.assertEqual(cur.fetchone(),None,
'cursor.fetchone should return None if no more rows available'
)
self.failUnless(cur.rowcount in (-1,1))
self.assertTrue(cur.rowcount in (-1,1))
finally:
con.close()

Expand Down Expand Up @@ -589,7 +589,7 @@ def test_fetchmany(self):
'cursor.fetchmany should return an empty sequence after '
'results are exhausted'
)
self.failUnless(cur.rowcount in (-1,6))
self.assertTrue(cur.rowcount in (-1,6))

# Same as above, using cursor.arraysize
cur.arraysize=4
Expand All @@ -602,12 +602,12 @@ def test_fetchmany(self):
self.assertEqual(len(r),2)
r = cur.fetchmany() # Should be an empty sequence
self.assertEqual(len(r),0)
self.failUnless(cur.rowcount in (-1,6))
self.assertTrue(cur.rowcount in (-1,6))

cur.arraysize=6
cur.execute('select name from %sbooze' % self.table_prefix)
rows = cur.fetchmany() # Should get all rows
self.failUnless(cur.rowcount in (-1,6))
self.assertTrue(cur.rowcount in (-1,6))
self.assertEqual(len(rows),6)
self.assertEqual(len(rows),6)
rows = [r[0] for r in rows]
Expand All @@ -624,7 +624,7 @@ def test_fetchmany(self):
'cursor.fetchmany should return an empty sequence if '
'called after the whole result set has been fetched'
)
self.failUnless(cur.rowcount in (-1,6))
self.assertTrue(cur.rowcount in (-1,6))

self.executeDDL2(cur)
cur.execute('select name from %sbarflys' % self.table_prefix)
Expand All @@ -633,7 +633,7 @@ def test_fetchmany(self):
'cursor.fetchmany should return an empty sequence if '
'query retrieved no rows'
)
self.failUnless(cur.rowcount in (-1,0))
self.assertTrue(cur.rowcount in (-1,0))

finally:
con.close()
Expand All @@ -657,7 +657,7 @@ def test_fetchall(self):

cur.execute('select name from %sbooze' % self.table_prefix)
rows = cur.fetchall()
self.failUnless(cur.rowcount in (-1,len(self.samples)))
self.assertTrue(cur.rowcount in (-1,len(self.samples)))
self.assertEqual(len(rows),len(self.samples),
'cursor.fetchall did not retrieve all rows'
)
Expand All @@ -673,12 +673,12 @@ def test_fetchall(self):
'cursor.fetchall should return an empty list if called '
'after the whole result set has been fetched'
)
self.failUnless(cur.rowcount in (-1,len(self.samples)))
self.assertTrue(cur.rowcount in (-1,len(self.samples)))

self.executeDDL2(cur)
cur.execute('select name from %sbarflys' % self.table_prefix)
rows = cur.fetchall()
self.failUnless(cur.rowcount in (-1,0))
self.assertTrue(cur.rowcount in (-1,0))
self.assertEqual(len(rows),0,
'cursor.fetchall should return an empty list if '
'a select query returns no rows'
Expand All @@ -700,7 +700,7 @@ def test_mixedfetch(self):
rows23 = cur.fetchmany(2)
rows4 = cur.fetchone()
rows56 = cur.fetchall()
self.failUnless(cur.rowcount in (-1,6))
self.assertTrue(cur.rowcount in (-1,6))
self.assertEqual(len(rows23),2,
'fetchmany returned incorrect number of rows'
)
Expand Down Expand Up @@ -777,7 +777,7 @@ def test_arraysize(self):
con = self._connect()
try:
cur = con.cursor()
self.failUnless(hasattr(cur,'arraysize'),
self.assertTrue(hasattr(cur,'arraysize'),
'cursor.arraysize must be defined'
)
finally:
Expand Down Expand Up @@ -846,27 +846,27 @@ def test_Binary(self):
b = self.driver.Binary(str2bytes(''))

def test_STRING(self):
self.failUnless(hasattr(self.driver,'STRING'),
self.assertTrue(hasattr(self.driver,'STRING'),
'module.STRING must be defined'
)

def test_BINARY(self):
self.failUnless(hasattr(self.driver,'BINARY'),
self.assertTrue(hasattr(self.driver,'BINARY'),
'module.BINARY must be defined.'
)

def test_NUMBER(self):
self.failUnless(hasattr(self.driver,'NUMBER'),
self.assertTrue(hasattr(self.driver,'NUMBER'),
'module.NUMBER must be defined.'
)

def test_DATETIME(self):
self.failUnless(hasattr(self.driver,'DATETIME'),
self.assertTrue(hasattr(self.driver,'DATETIME'),
'module.DATETIME must be defined.'
)

def test_ROWID(self):
self.failUnless(hasattr(self.driver,'ROWID'),
self.assertTrue(hasattr(self.driver,'ROWID'),
'module.ROWID must be defined.'
)

10 changes: 5 additions & 5 deletions psycopg2/tests/dbapi20_tpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def test_xid(self):
except self.driver.NotSupportedError:
self.fail("Driver does not support transaction IDs.")

self.assertEquals(xid[0], 42)
self.assertEquals(xid[1], "global")
self.assertEquals(xid[2], "bqual")
self.assertEqual(xid[0], 42)
self.assertEqual(xid[1], "global")
self.assertEqual(xid[2], "bqual")

# Try some extremes for the transaction ID:
xid = con.xid(0, "", "")
self.assertEquals(tuple(xid), (0, "", ""))
self.assertEqual(tuple(xid), (0, "", ""))
xid = con.xid(0x7fffffff, "a" * 64, "b" * 64)
self.assertEquals(tuple(xid), (0x7fffffff, "a" * 64, "b" * 64))
self.assertEqual(tuple(xid), (0x7fffffff, "a" * 64, "b" * 64))

def test_tpc_begin(self):
con = self.connect()
Expand Down
Loading

0 comments on commit 4039d98

Please sign in to comment.