You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ca...@codespot.com on 2012/07/09 21:31:23 UTC

[cassandra-dbapi2] push by pcannon@gmail.com - Unit test for prepared select. on 2012-07-09 19:31 GMT

Revision: ef34a87db21b
Author:   Nick Bailey <ni...@gmail.com>
Date:     Sat Jul  7 12:11:49 2012
Log:      Unit test for prepared select.

http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/source/detail?r=ef34a87db21b

Modified:
  /test/test_prepared_queries.py

=======================================
--- /test/test_prepared_queries.py	Sat Mar 24 13:09:16 2012
+++ /test/test_prepared_queries.py	Sat Jul  7 12:11:49 2012
@@ -92,6 +92,18 @@
          results = self.cursor.fetchone()
          self.assertEqual(results[2], '\x00\xff\x80\x08')

+    def test_prepared_select_no_terms(self):
+        if self.cursor is None:
+            return
+
+        q = self.cursor.prepare_query("select thekey, thedecimal, theblob  
from abc")
+
+        self.cursor.execute_prepared(q, {})
+        results = self.cursor.fetchall()
+        floats = set(row[1] for row in results)
+
+        self.assertEqual(set([None, decimal.Decimal('-14.400')]), floats)
+
      def test_prepared_insert(self):
          if self.cursor is None:
              return