Commits

Olemis Lang  committed ba3fbfa

GViz QL [ refs dataviz-302 ] : Test case for ICU predefined RBNF result sets with no_values OPTION set ... ok

  • Participants
  • Parent commits fdb8884

Comments (0)

Files changed (1)

File trac-dev/gviz/tracgviz/testing/test_gvizql.py

          dayOfWeek(hireDate) = (2, 'Mon')
 
 
-
-      >>> parse("select * options no_format , no_values , "
-      ...       "format_engine:'salary:NumberRule'", 'opts', 'cols')
+      >>> parse("select name, age, isSenior format age 'SPELLOUT' "
+      ...       "options no_values , format_syntax:'age:PredefinedNumberRule' ",
+      ...       'opts', 'cols', 'fmt')
       *****
       * Tokens
       *****
       Token.Keyword.Reserved select
-      Token.Name.Other *
+      Token.Name.Variable name
+      Token.Punctuation ,
+      Token.Name.Variable age
+      Token.Punctuation ,
+      Token.Name.Variable isSenior
+      Token.Keyword.Reserved format
+      Token.Name.Variable age
+      Token.Literal.String.Single 'SPELLOUT'
       Token.Keyword.Reserved options
-      Token.Name.Variable no_format
-      Token.Punctuation ,
       Token.Name.Variable no_values
       Token.Punctuation ,
-      Token.Name.Variable format_engine
+      Token.Name.Variable format_syntax
       Token.Punctuation :
-      Token.Literal.String.Single 'salary:NumberRule'
+      Token.Literal.String.Single 'age:PredefinedNumberRule'
       *****
       * Parsing
       *****
-      Contradictory options no_value and no_format
+      [('no_values', None), (u'format_syntax', 'age:PredefinedNumberRule')]
+      ['name', 'age', 'isSenior']
+      [('age', 'SPELLOUT')]
+      *****
+      * Result
+      *****
+      = Columns =
+      name string
+      age number
+      isSenior boolean
+      = Row =
+         name = (None, 'John')
+         age = (None, 'thirty-five')
+         isSenior = (None, 'true')
+      = Row =
+         name = (None, 'Dave')
+         age = (None, 'twenty-seven')
+         isSenior = (None, 'false')
+      = Row =
+         name = (None, 'Sally')
+         age = (None, 'thirty')
+         isSenior = (None, 'false')
+      = Row =
+         name = (None, 'Ben')
+         age = (None, 'thirty-two')
+         isSenior = (None, 'true')
+      = Row =
+         name = (None, 'Dana')
+         age = (None, 'twenty-five')
+         isSenior = (None, 'false')
+      = Row =
+         name = (None, 'Mike')
+         age = (None, 'twenty-four')
+         isSenior = (None, 'true')
 
       """,
   'Parsing OPTIONS errors' : r"""
       *****
       GVizIllegalPattern  :  Formatting syntax PredefinedNumberRule not available for date
 
+
+      >>> parse("select * options no_format , no_values , "
+      ...       "format_engine:'salary:NumberRule'", 'opts', 'cols')
+      *****
+      * Tokens
+      *****
+      Token.Keyword.Reserved select
+      Token.Name.Other *
+      Token.Keyword.Reserved options
+      Token.Name.Variable no_format
+      Token.Punctuation ,
+      Token.Name.Variable no_values
+      Token.Punctuation ,
+      Token.Name.Variable format_engine
+      Token.Punctuation :
+      Token.Literal.String.Single 'salary:NumberRule'
+      *****
+      * Parsing
+      *****
+      Contradictory options no_value and no_format
       """,
     'Parsing (failures)' : r"""
       >>> parse("  select ", 'cols', fail=True)