~jelmer/storm/cast

« back to all changes in this revision

Viewing changes to tests/expr.py

  • Committer: Jelmer Vernooij
  • Date: 2010-11-24 20:30:01 UTC
  • Revision ID: jelmer@samba.org-20101124203001-2f0mficldpf05sr4
Add Cast() function to storm.expr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1380
1380
    def test_count_distinct_all(self):
1381
1381
        self.assertRaises(ValueError, Count, distinct=True)
1382
1382
 
 
1383
    def test_cast(self):
 
1384
        expr = Cast(Func1(), "TEXT")
 
1385
        state = State()
 
1386
        statement = compile(expr, state)
 
1387
        self.assertEquals(statement, "CAST(func1() AS TEXT)")
 
1388
        self.assertEquals(state.parameters, [])
 
1389
 
1383
1390
    def test_max(self):
1384
1391
        expr = Max(Func1())
1385
1392
        state = State()