예제 #1
0
    def test_publish_on_disabled_event(self):
        event = Event('disabled')
        event.disable()

        # noinspection PyShadowingNames
        @event.subscribe()
        async def funny_handler(message, publisher, event):
            return [message, publisher, event]

        with Loop(event.publish('sad message')) as loop:
            result = loop.run_until_complete()

        self.assertIsNone(result)
예제 #2
0
파일: test_event.py 프로젝트: pawelzny/eeee
    def test_disable(self):
        event = Event('Disable manually')
        self.assertTrue(event.is_enable)

        event.disable()
        self.assertFalse(event.is_enable)