#NEWLINE# def test_get_command_names( self ) : #NEWLINE# #INDENT# mock_cmd_one = mock . Mock ( ) #NEWLINE# mock_cmd_one . name = 'one' #NEWLINE# mock_cmd_two = mock . Mock ( ) #NEWLINE# mock_cmd_two . name = 'cmd two' #NEWLINE# mock_pkg_resources = mock . Mock ( return_value = [ mock_cmd_one , mock_cmd_two ] ) #NEWLINE# with mock . patch ( 'pkg_resources.iter_entry_points' , mock_pkg_resources ) as iter_entry_points : #NEWLINE# #INDENT# mgr = commandmanager . CommandManager ( 'test' ) #NEWLINE# iter_entry_points . assert_called_once_with ( 'test' ) #NEWLINE# cmds = mgr . get_command_names ( 'test' ) #NEWLINE# self . assertEqual ( [ 'one' , 'cmd two' ] , cmds )