cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cassandra-dbapi2.apache-extras....@codespot.com
Subject [cassandra-dbapi2] push by pcannon@gmail.com - Unit test for prepared select. on 2012-07-09 19:31 GMT
Date Mon, 09 Jul 2012 19:31:23 GMT
Revision: ef34a87db21b
Author:   Nick Bailey <nickmbailey@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

Mime
View raw message