예제 #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()])