Esempio n. 1
0
 def test_compile_EvalNot(self):
     c_not = qc.EvalNot(qc.EvalConstant(17))
     self.assertEqual(bool, c_not.dtype)
Esempio n. 2
0
 def test_expr_constant(self):
     self.assertEqual(qc.EvalConstant(D(17)),
                      qc.compile_expression(qp.Constant(D(17)), qe.TargetsEnvironment()))
Esempio n. 3
0
 def test_print_from(self):
     self.assertCompile(qc.EvalPrint(
         qc.EvalFrom(qc.EvalEqual(qe.YearEntryColumn(), qc.EvalConstant(2014)),
                     None, None, None)
         ), "PRINT FROM year = 2014;")
Esempio n. 4
0
 def test_compile_EvalOr(self):
     c_or = qc.EvalOr(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(bool, c_or.dtype)
Esempio n. 5
0
 def test_compile_EvalSub(self):
     c_plus = qc.EvalSub(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(Decimal, c_plus.dtype)
Esempio n. 6
0
 def test_compile_EvalMatch(self):
     with self.assertRaises(qc.CompilationError):
         qc.EvalMatch(qc.EvalConstant('testing'), qc.EvalConstant(18))
     c_equal = qc.EvalMatch(qc.EvalConstant('testing'), qc.EvalConstant('test.*'))
     self.assertEqual(bool, c_equal.dtype)
Esempio n. 7
0
 def test_compile_EvalAnd(self):
     c_and = qc.EvalAnd(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(bool, c_and.dtype)
Esempio n. 8
0
 def test_compile_EvalGreaterEq(self):
     c_ge = qc.EvalGreaterEq(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(bool, c_ge.dtype)
Esempio n. 9
0
 def test_compile_EvalLessEq(self):
     c_le = qc.EvalLessEq(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(bool, c_le.dtype)
Esempio n. 10
0
 def test_compile_EvalEqual(self):
     c_equal = qc.EvalEqual(qc.EvalConstant(17), qc.EvalConstant(18))
     self.assertEqual(bool, c_equal.dtype)
Esempio n. 11
0
 def test_compile_EvalLast(self):
     c_last = qe.Last([qc.EvalConstant(17.)])
     self.assertEqual(float, c_last.dtype)
Esempio n. 12
0
 def test_compile_EvalCount(self):
     c_count = qe.Count([qc.EvalConstant(17)])
     self.assertEqual(int, c_count.dtype)
Esempio n. 13
0
 def test_compile_EvalDay(self):
     with self.assertRaises(qc.CompilationError):
         qe.Day([qc.EvalConstant(17)])
     c_day = qe.Day([qc.EvalConstant(datetime.date.today())])
     self.assertEqual(int, c_day.dtype)
Esempio n. 14
0
 def test_compile_EvalLength(self):
     with self.assertRaises(qc.CompilationError):
         qe.Length([qc.EvalConstant(17)])
     c_length = qe.Length([qc.EvalConstant('testing')])
     self.assertEqual(int, c_length.dtype)