Пример #1
0
 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()])
Пример #2
0
 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()])
Пример #3
0
 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()])
Пример #4
0
 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()])