Beispiel #1
0
    def test_print_with_no_filter(self):
        statement = qc.EvalPrint(qc.EvalFrom(None, None, None, None))
        oss = io.StringIO()
        qx.execute_print(statement, self.entries, self.options_map, oss)
        self.assertEqualEntries(self.INPUT, oss.getvalue())

        statement = qc.EvalPrint(None)
        oss = io.StringIO()
        qx.execute_print(statement, self.entries, self.options_map, oss)
        self.assertEqualEntries(self.INPUT, oss.getvalue())
Beispiel #2
0
 def test_print_from(self):
     self.assertCompile(
         qc.EvalPrint(
             qc.EvalFrom(
                 qc.Operator(qp.Equal, [
                     qe.YearEntryColumn(),
                     qc.EvalConstant(2014),
                 ]), None, None, None)), """PRINT FROM year = 2014;""")
Beispiel #3
0
    def test_print_with_filter(self):
        statement = qc.EvalPrint(
            qc.EvalFrom(
                qc.EvalEqual(qe.YearEntryColumn(), qc.EvalConstant(2012)),
                None, None, None))
        oss = io.StringIO()
        qx.execute_print(statement, self.entries, self.options_map, oss)

        self.assertEqualEntries(
            """

          2012-02-02 * "Dinner with Dos"
            Assets:Bank:Checking                                                   102.00 USD
            Expenses:Restaurant                                                   -102.00 USD

        """, oss.getvalue())
Beispiel #4
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;")
Beispiel #5
0
 def test_print(self):
     self.assertCompile(qc.EvalPrint(None), "PRINT;")