<s> from pyjamas . ui . RootPanel import RootPanel <EOL> from pyjamas . ui . Button import Button <EOL> from UnitTest import UnitTest1 <EOL> from pyjamas import DOM <EOL> class EventTest ( UnitTest1 ) : <EOL> def onClick ( self , sender ) : <EOL> self . assertTrue ( sender == self . b ) <EOL> self . buttonClickTestOccurred = True <EOL> def testButtonClick ( self ) : <EOL> self . buttonClickTestOccurred = False <EOL> self . b = Button ( "<STR_LIT>" , self ) <EOL> RootPanel ( '<STR_LIT>' ) . add ( self . b ) <EOL> self . write_test_output ( '<STR_LIT>' ) <EOL> DOM . buttonClick ( self . b . getElement ( ) ) <EOL> if not RootPanel ( '<STR_LIT>' ) . remove ( self . b ) : <EOL> self . fail ( "<STR_LIT>" ) <EOL> self . write_test_output ( '<STR_LIT>' ) <EOL> def lastTestChecks ( self ) : <EOL> self . assertTrue ( self . buttonClickTestOccurred , '<STR_LIT>' ) </s>
