Example #1
0
 def test_post_commit_does_not_raise_exception(self):
     with mock.patch.object(impl_idl.OvsVsctlTransaction,
                            "do_post_commit",
                            side_effect=Exception):
         transaction = impl_idl.OvsVsctlTransaction(mock.sentinel,
                                                    mock.Mock(), 0)
         transaction.post_commit(mock.Mock())
Example #2
0
 def test_commit_raises_exception_on_timeout(self):
     transaction = impl_idl.OvsVsctlTransaction(mock.sentinel, mock.Mock(),
                                                1)
     with self.assert_max_execution_time(10):
         with testtools.ExpectedException(exceptions.TimeoutException):
             transaction.commit()