Revision: ce0e7ea8b331
Author:   paul cannon <[email protected]>
Date:     Tue Jan 24 13:28:44 2012
Log:      add unit test for comments in strings

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

Modified:
 /test/test_query_preparation.py

=======================================
--- /test/test_query_preparation.py     Tue Dec 13 14:56:06 2011
+++ /test/test_query_preparation.py     Tue Jan 24 13:28:44 2012
@@ -39,6 +39,12 @@
 """
SELECT :lo..:hi FROM ColumnFamily WHERE KEY=':dontsubstthis' AND col > /* ignore :this */ :colval23;
 """,
+"""
+USE :some_ks;
+""",
+"""
+INSERT INTO cf (key, col1, col2) VALUES ('http://one.two.three/four?five /* :name */', :name);
+""",
 )

 ARGUMENTS = (
@@ -48,6 +54,8 @@
     {'_a_': 12},
     {'opt': "abc'", 'unused': 'thatsok', 'value': '\n'},
     {'lo': ' ', 'hi': ':hi', 'colval23': 0.2},
+    {'some_ks': 'abc'},
+    {'name': "// a literal 'comment'"},
 )

 STANDARDS = (
@@ -70,6 +78,12 @@
 """
SELECT ' '..':hi' FROM ColumnFamily WHERE KEY=':dontsubstthis' AND col
                   0.2;
 """,
+"""
+USE 'abc';
+""",
+"""
+INSERT INTO cf (key, col1, col2) VALUES ('http://one.two.three/four?five /* :name */', '// a literal ''comment''');
+""",
 )

 class TestPrepare(unittest.TestCase):

Reply via email to