def test_filter_defer_with_exception(self): try: with self.firewall.defer_apply(): raise Exception("same exception") except: pass self.iptables_inst.assert_has_calls([call.defer_apply_on(), call.defer_apply_off()])
def test_filter_defer_with_exception(self): try: with self.firewall.defer_apply(): raise Exception("same exception") except Exception: pass self.iptables_inst.assert_has_calls([call.defer_apply_on(), call.defer_apply_off()])
def test_defer_apply(self): with self.firewall.defer_apply(): pass self.iptables_inst.assert_has_calls([call.defer_apply_on(), call.defer_apply_off()])