Exemplo n.º 1
0
    def test_hooks(self):
        s = State('s',
                  will_enter=self.sample_hook('wen'),
                  will_exit=self.sample_hook('wex'),
                  entered=self.sample_hook('en'),
                  exited=self.sample_hook('ex'))

        assert s.will_enter() == 'wen'
        assert s.will_exit() == 'wex'
        assert s.entered() == 'en'
        assert s.exited() == 'ex'
Exemplo n.º 2
0
 def test_empty(self):
     s = State('s')
     assert s.will_enter() == None
     assert s.will_exit() == None
     assert s.entered() == None
     assert s.exited() == None