def test_emit(self): connect_screen = UIScreen() App.initialize(scheduler=MagicMock()) connect_screen.connect(TestSignal, self._callback) connect_screen.emit(TestSignal(self)) App.get_event_loop().process_signals() self.assertTrue(self.callback_called)
def test_basic_connect(self): connect_screen = UIScreen() App.initialize(scheduler=MagicMock()) connect_screen.connect(SignalMock, self._callback) App.get_event_loop().enqueue_signal(SignalMock(self)) App.get_event_loop().process_signals() self.assertTrue(self.callback_called)