<s> from circuits import Component , Event <EOL> class foo ( Event ) : <EOL> """<STR_LIT>""" <EOL> class done ( Event ) : <EOL> """<STR_LIT>""" <EOL> class App ( Component ) : <EOL> def init ( self ) : <EOL> self . results = [ ] <EOL> def foo ( self , value ) : <EOL> self . results . append ( value ) <EOL> def done ( self ) : <EOL> self . stop ( ) <EOL> def test1 ( ) : <EOL> app = App ( ) <EOL> [ app . fire ( foo ( <NUM_LIT:1> ) ) , app . fire ( foo ( <NUM_LIT:2> ) ) ] <EOL> app . fire ( done ( ) ) <EOL> app . run ( ) <EOL> assert app . results == [ <NUM_LIT:1> , <NUM_LIT:2> ] <EOL> def test2 ( ) : <EOL> app = App ( ) <EOL> [ app . fire ( foo ( <NUM_LIT:1> ) , priority = <NUM_LIT:2> ) , app . fire ( foo ( <NUM_LIT:2> ) , priority = <NUM_LIT:0> ) ] <EOL> app . fire ( done ( ) ) <EOL> app . run ( ) <EOL> assert app . results == [ <NUM_LIT:2> , <NUM_LIT:1> ] </s>
