예제 #1
0
    def test_system(self):
        emitter = Emitter()
        assert emitter.system == ''

        val = 'test_set_system'
        emitter.system = val
        emitter.top.system = val
        assert emitter.system == val
예제 #2
0
    def test_setters_are_event_top(self):
        event_stack = tevent_stack()
        emitter = Emitter(event_stack=event_stack)
        emitter.system = 'test_setters_are_event_top'
        assert emitter.system == 'test_setters_are_event_top'
        assert emitter.event_stack.top.system == 'test_setters_are_event_top'
        assert emitter.event_stack.bot.system == 'test.pyemit'

        top = emitter.event_stack.pop()
        assert top.system == 'test_setters_are_event_top'
        assert emitter.system == ''
        assert emitter.event_stack.top.system == ''
        assert emitter.event_stack.bot.system == 'test.pyemit'