def test_nested_tx_rollback_outer(self):
        # Prepare state
        with local_db.Transaction() as tx:
            tx.execute('INSERT INTO tests VALUES (:k, :v)', k='foo', v='bar')

        # Run outer rollback from inner tx
        try:
            with local_db.Transaction() as tx1:
                tx1.execute('UPDATE tests SET value=:v WHERE key=:k',
                            k='foo', v='baz')
                with local_db.Transaction() as tx2:
                    tx2.execute('UPDATE tests SET value=:v WHERE key=:k',
                                k='foo', v='qux')
                    raise RuntimeError()
        except __HOLE__:
            pass
        with local_db.Transaction() as tx:
            row = tx.query_one('SELECT value FROM tests WHERE key=:k', k='foo')
            self.assertEqual('bar', row['value'])
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/tests/lib/utils/test_local_db.py/LocalDbTestCase.test_nested_tx_rollback_outer