[Checkins] SVN: Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/ test setup goes to tests

Adam Groszer agroszer at gmail.com
Wed Aug 6 06:59:26 EDT 2008


Log message for revision 89433:
  test setup goes to tests

Changed:
  U   Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/compiler/compiler.txt
  U   Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/parser/newqueryparser.py
  U   Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/rewriter/rewriter.txt
  U   Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/tests/run.txt

-=-
Modified: Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/compiler/compiler.txt
===================================================================
--- Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/compiler/compiler.txt	2008-08-06 09:57:35 UTC (rev 89432)
+++ Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/compiler/compiler.txt	2008-08-06 10:59:25 UTC (rev 89433)
@@ -11,9 +11,12 @@
 
     >>> from ocql.testing.database import TestMetadata
 
-    >>> from ocql.compiler.compiler import registerAdapters
-    >>> registerAdapters()
+    >>> import ocql.compiler.compiler
+    >>> ocql.compiler.compiler.registerAdapters()
 
+    >>> import ocql.rewriter.rewriter
+    >>> ocql.rewriter.rewriter.registerAdapters()
+
     >>> metadata = TestMetadata()
     >>> qo = QueryParser("set [ | 1 ]")(metadata)
     >>> opt = QueryOptimizer(qo)()

Modified: Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/parser/newqueryparser.py
===================================================================
--- Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/parser/newqueryparser.py	2008-08-06 09:57:35 UTC (rev 89432)
+++ Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/parser/newqueryparser.py	2008-08-06 10:59:25 UTC (rev 89433)
@@ -14,14 +14,13 @@
 from ply import lex, yacc
 from collections import deque
 from threading import local
-    
+
 from zope.component import adapts
 from zope.component import provideAdapter
 from zope.interface import implements
 
 from ocql.queryobject.queryobject import *
 from ocql.interfaces import IQueryParser
-from ocql.rewriter.rewriter import registerAdapters
 
 DEBUG = 0
 
@@ -114,7 +113,7 @@
 
     def t_AS(self, t):
         r'as'
-        return t    
+        return t
 
     def t_IN(self, t):
         r'in'
@@ -298,7 +297,7 @@
         t[0] = Query(self.metadata, self.symbols, t[1], t[3], t[5])
         if DEBUG: print 'reducing "collection SBRACKET_L qualifier PIPE expression SBRACKET_R" to "expression"', t[0]
 
-#TODO add a test 
+#TODO add a test
     def p_expr_for_query(self, t):
         r'''expression : collection SBRACKET_L qualifier FOR expression SBRACKET_R
         '''
@@ -348,7 +347,7 @@
         if DEBUG: print 'reducing "bag" to "collection"', t[0]
 
     def p_qualifier_null(self, t):
-        r'''qualifier : 
+        r'''qualifier :
         '''
         t[0] = []
         if DEBUG: print 'reducing "" to "qualifier"', t[0]
@@ -472,8 +471,8 @@
         '''
         t[0] = Ne(self.metadata, self.symbols, t[1], t[3])
         if DEBUG: print 'reducing "quantified operator quantified" to "condition"', t[0]
-    
-    #need to extend this for collection of types 
+
+    #need to extend this for collection of types
     def p_condition_isinstance(self, t):
         r'''condition : ISINSTANCE BRACKET_L expression COMMA IDENTIFIER BRACKET_R
         '''
@@ -535,7 +534,7 @@
         if DEBUG: print 'reducing "collection CBRACKET_L element CBRACKET_R" to "literal"', t[0]
 
     def p_element_null(self, t):
-        r'''element : 
+        r'''element :
         '''
         t[0] = None
         if DEBUG: print 'reducing "" to "element"', t[0]
@@ -584,7 +583,7 @@
         if DEBUG: print 'reducing "IDENTIFIER BRACKET_L argument_list BRACKET_R" to "method"', t[0]
 
     def p_argument_list_null(self, t):
-        r'''argument_list : 
+        r'''argument_list :
         '''
         t[0] = None
         if DEBUG: print 'reducing "" to "argument_list"', t[0]
@@ -641,7 +640,6 @@
 class QueryParser(object):
     implements(IQueryParser)
     adapts(basestring)
-    registerAdapters()
 
     def __init__(self, context):
         self.context = context

Modified: Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/rewriter/rewriter.txt
===================================================================
--- Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/rewriter/rewriter.txt	2008-08-06 09:57:35 UTC (rev 89432)
+++ Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/rewriter/rewriter.txt	2008-08-06 10:59:25 UTC (rev 89433)
@@ -12,7 +12,10 @@
 
     >>> from ocql.testing.database import TestMetadata
 
+    >>> import ocql.rewriter.rewriter
+    >>> ocql.rewriter.rewriter.registerAdapters()
 
+
     >>> qo = QueryParser("set [ | 1 ]")(TestMetadata())
     >>> opt = QueryOptimizer(qo)()
     >>> alg = Rewriter(opt)()

Modified: Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/tests/run.txt
===================================================================
--- Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/tests/run.txt	2008-08-06 09:57:35 UTC (rev 89432)
+++ Sandbox/adamg/ocql/branches/qo-compiler/src/ocql/tests/run.txt	2008-08-06 10:59:25 UTC (rev 89433)
@@ -19,10 +19,13 @@
 
     >>> from ocql.engine import OCQLEngine
 
-    >>> from ocql.compiler.compiler import registerAdapters
-    >>> registerAdapters()
+    >>> import ocql.compiler.compiler
+    >>> ocql.compiler.compiler.registerAdapters()
 
+    >>> import ocql.rewriter.rewriter
+    >>> ocql.rewriter.rewriter.registerAdapters()
 
+
     >>> engine = OCQLEngine()
     >>> run = engine.compile("set [ | 1 ]")
     >>> run



More information about the Checkins mailing list