#NEWLINE# def test_edit_handler( ) : #NEWLINE# #INDENT# env = { #NEWLINE# #INDENT# 'EDITOR' : 'my-editor' , #NEWLINE# #UNINDENT# } #NEWLINE# popen_cls = mock . Mock ( ) #NEWLINE# context = mock . Mock ( ) #NEWLINE# context . history = [ ] #NEWLINE# handler = app . EditHandler ( env , env ) #NEWLINE# handler . run ( [ '.edit' ] , context ) #NEWLINE# command_run = popen_cls . call_args [ 0 ] [ 0 ] #NEWLINE# assert ( len ( command_run ) == 2 ) #NEWLINE# assert ( command_run [ 0 ] == 'my-editor' )