Esempio n. 1
0
 def test_callback_unauthorized_append(self):
     self.name = 'test_callback_unauthorized_append'
     signals.register_handler(signal.SIGTERM, self.set_flag_handler)
     with self.assertRaises(exceptions.MultipleSignalHandlersError):
         signals.register_callback(
             signal.SIGTERM, self.set_flag_callback, append=False, args=[None])
     os.kill(os.getpid(), signal.SIGTERM)
Esempio n. 2
0
 def test_callback_unauthorized_append(self):
     self.name = 'test_callback_unauthorized_append'
     signals.register_handler(signal.SIGTERM, self.set_flag_handler)
     with self.assertRaises(exceptions.MultipleSignalHandlersError):
         signals.register_callback(signal.SIGTERM,
                                   self.set_flag_callback,
                                   append=False,
                                   args=[None])
     os.kill(os.getpid(), signal.SIGTERM)
Esempio n. 3
0
 def test_callbacks_call_order_is_lifo(self):
     self.name = 'test_callbacks_call_order_is_lifo'
     signals.register_callback(signal.SIGTERM,
                               self.append_list_callback,
                               args=[3])
     signals.register_callback(signal.SIGTERM,
                               self.append_list_callback,
                               args=[2])
     signals.register_callback(signal.SIGTERM,
                               self.append_list_callback,
                               args=[1])
     os.kill(os.getpid(), signal.SIGTERM)
Esempio n. 4
0
 def test_callback(self):
     self.name = 'test_callback'
     signals.register_callback(signal.SIGTERM,
                               self.set_flag_callback,
                               args=[None])
     os.kill(os.getpid(), signal.SIGTERM)
Esempio n. 5
0
 def test_callbacks_call_order_is_lifo(self):
     self.name = 'test_callbacks_call_order_is_lifo'
     signals.register_callback(signal.SIGTERM, self.append_list_callback, args=[3])
     signals.register_callback(signal.SIGTERM, self.append_list_callback, args=[2])
     signals.register_callback(signal.SIGTERM, self.append_list_callback, args=[1])
     os.kill(os.getpid(), signal.SIGTERM)
Esempio n. 6
0
 def test_callback(self):
     self.name = 'test_callback'
     signals.register_callback(signal.SIGTERM, self.set_flag_callback, args=[None])
     os.kill(os.getpid(), signal.SIGTERM)