#NEWLINE# @ unittest . skipIf ( no_modal_dialog_tester , 'ModalDialogTester unavailable' ) #NEWLINE# def test_accept( self ) : #NEWLINE# #INDENT# tester = ModalDialogTester ( self . dialog . open ) #NEWLINE# tester . open_and_run ( when_opened = ( lambda x : x . close ( accept = True ) ) ) #NEWLINE# self . assertEqual ( tester . result , OK ) #NEWLINE# self . assertEqual ( self . dialog . return_code , OK )