コード例 #1
0
    def test_persistent_tables(self):
        with Session() as session1:
            session1 = Session()
            session1.run_script('t = None')
            t = session1.empty_table(10)
            session1.bind_table('t', t)


        with Session(sync_fields=SYNC_ONCE) as session2:
            self.assertIn('t', session2.tables)
コード例 #2
0
    def test_shared_tables(self):
        session1 = Session(sync_fields=SYNC_REPEATED)
        session1.run_script('t = None')

        session2 = Session()
        t = session2.empty_table(10)
        session2.bind_table('t', t)

        @timeout_decorator.timeout(seconds=1)
        def wait_for_table():
            while 't' not in session1.tables:
                pass

        try:
            wait_for_table()
        except timeout_decorator.TimeoutError:
            self.fail('table did not get synced to session1')