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)))))
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))
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))
def test_balances_empty(self): self.assertParse("BALANCES;", qp.Balances(None, None, None))
def test_explain_balances(self): self.assertParse(qp.Explain(qp.Balances('cost', None, None)), "EXPLAIN BALANCES AT cost;")