[pypy-svn] r69350 - in pypy/trunk/pypy/module/oracle: . test

afa at codespeak.net afa at codespeak.net
Tue Nov 17 15:09:46 CET 2009


Author: afa
Date: Tue Nov 17 15:09:46 2009
New Revision: 69350

Modified:
   pypy/trunk/pypy/module/oracle/interp_cursor.py
   pypy/trunk/pypy/module/oracle/test/test_cursor.py
Log:
add cursor.statement


Modified: pypy/trunk/pypy/module/oracle/interp_cursor.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/interp_cursor.py	(original)
+++ pypy/trunk/pypy/module/oracle/interp_cursor.py	Tue Nov 17 15:09:46 2009
@@ -2,7 +2,7 @@
 from pypy.interpreter.gateway import ObjSpace, W_Root, NoneNotWrapped
 from pypy.interpreter.argument import Arguments
 from pypy.interpreter.typedef import TypeDef, GetSetProperty
-from pypy.interpreter.typedef import interp_attrproperty
+from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w
 from pypy.interpreter.gateway import interp2app
 from pypy.interpreter.error import OperationError
 from pypy.rpython.lltypesystem import rffi, lltype
@@ -780,4 +780,5 @@
 
     arraysize = GetSetProperty(cursor_arraysize_get, cursor_arraysize_set),
     rowcount = interp_attrproperty('rowCount', W_Cursor),
+    statement = interp_attrproperty_w('w_statement', W_Cursor),
 )

Modified: pypy/trunk/pypy/module/oracle/test/test_cursor.py
==============================================================================
--- pypy/trunk/pypy/module/oracle/test/test_cursor.py	(original)
+++ pypy/trunk/pypy/module/oracle/test/test_cursor.py	Tue Nov 17 15:09:46 2009
@@ -117,3 +117,11 @@
         count, = cur.fetchone()
         assert count == len(rows)
 
+    def test_attributes(self):
+        cur = self.cnx.cursor()
+        stmt = "select 1 from dual"
+        cur.execute(stmt)
+        assert cur.rowcount == 0
+        cur.fetchall()
+        assert cur.rowcount == 1
+        assert cur.statement == stmt



More information about the Pypy-commit mailing list