예제 #1
0
 def test_balances_from_with_transformer_simple(self):
     self.assertParse(
         "BALANCES AT units WHERE date = 2014-01-01;",
         qp.Balances(
             'units', None,
             qp.Equal(qp.Column('date'),
                      qp.Constant(datetime.date(2014, 1, 1)))))
예제 #2
0
 def test_balances_from_with_transformer(self):
     self.assertParse(
         "BALANCES AT units FROM date = 2014-01-01 CLOSE;",
         qp.Balances(
             'units',
             qp.From(
                 qp.Equal(qp.Column('date'),
                          qp.Constant(datetime.date(2014, 1, 1))), None,
                 True, None), None))
예제 #3
0
 def test_balances_from(self):
     self.assertParse(
         "BALANCES FROM date = 2014-01-01 CLOSE;",
         qp.Balances(
             None,
             qp.From(
                 qp.Equal(qp.Column('date'),
                          qp.Constant(datetime.date(2014, 1, 1))), None,
                 True, None), None))
예제 #4
0
 def test_balances_empty(self):
     self.assertParse("BALANCES;", qp.Balances(None, None, None))
예제 #5
0
 def test_explain_balances(self):
     self.assertParse(qp.Explain(qp.Balances('cost', None, None)),
                      "EXPLAIN BALANCES AT cost;")