|
@@ -1134,11 +1134,32 @@ def convert(value): |
|
|
self.assertEqual(value, None)
|
|
|
self.cnxn.clear_output_converters()
|
|
|
|
|
|
-
|
|
|
def test_login_timeout(self):
|
|
|
# This can only test setting since there isn't a way to cause it to block on the server side.
|
|
|
cnxns = pyodbc.connect(self.connection_string, timeout=2)
|
|
|
|
|
|
+ def test_row_equal(self):
|
|
|
+ self.cursor.execute("create table t1(n int, s varchar(20))")
|
|
|
+ self.cursor.execute("insert into t1 values (1, 'test')")
|
|
|
+ row1 = self.cursor.execute("select n, s from t1").fetchone()
|
|
|
+ row2 = self.cursor.execute("select n, s from t1").fetchone()
|
|
|
+ b = (row1 == row2)
|
|
|
+ self.assertEqual(b, True)
|
|
|
+
|
|
|
+ def test_row_gtlt(self):
|
|
|
+ self.cursor.execute("create table t1(n int, s varchar(20))")
|
|
|
+ self.cursor.execute("insert into t1 values (1, 'test1')")
|
|
|
+ self.cursor.execute("insert into t1 values (1, 'test2')")
|
|
|
+ rows = self.cursor.execute("select n, s from t1 order by s").fetchall()
|
|
|
+ self.assert_(rows[0] < rows[1])
|
|
|
+ self.assert_(rows[0] <= rows[1])
|
|
|
+ self.assert_(rows[1] > rows[0])
|
|
|
+ self.assert_(rows[1] >= rows[0])
|
|
|
+ self.assert_(rows[0] != rows[1])
|
|
|
+
|
|
|
+ rows = list(rows)
|
|
|
+ rows.sort() # uses <
|
|
|
+
|
|
|
|
|
|
def main():
|
|
|
from optparse import OptionParser
|
|
|
0 comments on commit
d89d7e9