Example #1
0
    def test_DelayTasks2(self):
        FT = BaseSingleFactorTableNode(conn)
        FT('show tables', delay=True)
        FT('show tables from system', delay=True)

        self.assertEqual(len(FT.delay_tasks), 2)
        del FT
Example #2
0
    def test_delay_run(self):
        FT = BaseSingleFactorTableNode(conn)
        FT('show tables', delay=True)
        FT('show tables from system', delay=True)

        res = FT.delay_tasks.run(no_yield=True)

        self.assertEqual(len(res), 2)
Example #3
0
    def test_DelayTasks3_delay_False(self):
        FT = BaseSingleFactorTableNode(conn)
        res = FT('show tables', delay=False)
        FT('show tables', delay=True)
        res2 = FT.delay_tasks.run(no_yield=True)[0]

        self.assertEqual(len(FT.delay_tasks), 1)
        self.assertEqual(all(res == res2), True)
Example #4
0
    def test_delay_run2(self):
        FT = BaseSingleFactorTableNode(conn)
        FT('show tables', delay=True)
        FT('show tables from system', delay=True)

        res = FT.delay_tasks.run(no_yield=True)

        self.assertEqual(True, all(res[0] == FT('show tables')))
        self.assertEqual(True, all(res[1] == FT('show tables from system')))
Example #5
0
    def test_delay_run_yield(self):
        FT = BaseSingleFactorTableNode(conn)
        FT('show tables', delay=True)
        FT('show tables from system', delay=True)

        res = FT.delay_tasks.run(no_yield=False)

        from collections import Iterable
        self.assertIsInstance(res, Iterable)