#NEWLINE# def test_actions_make_submenus_before_and_after( self ) : #NEWLINE# #INDENT# ' actions make submenus before and after ' #NEWLINE# action_sets = [ ActionSet ( actions = [ Action ( class_name = 'File' , path = 'MenuBar/File/New' , after = 'Folder' ) , Action ( class_name = 'Project' , path = 'MenuBar/File/New' , before = 'Folder' ) , Action ( class_name = 'Folder' , path = 'MenuBar/File/New' ) ] ) ] #NEWLINE# builder = DummyActionManagerBuilder ( action_sets = action_sets ) #NEWLINE# menu_manager = builder . create_menu_bar_manager ( 'MenuBar' ) #NEWLINE# self . assertEqual ( 1 , len ( menu_manager . groups ) ) #NEWLINE# additions = menu_manager . find_group ( 'additions' ) #NEWLINE# self . assertEqual ( 'File' , additions . items [ 0 ] . id ) #NEWLINE# menu = menu_manager . find_item ( 'File' ) #NEWLINE# additions = menu . find_group ( 'additions' ) #NEWLINE# self . assertEqual ( 'New' , additions . items [ 0 ] . id ) #NEWLINE# menu = menu_manager . find_item ( 'File/New' ) #NEWLINE# additions = menu . find_group ( 'additions' ) #NEWLINE# ids = [ item . id for item in additions . items ] #NEWLINE# self . assertEqual ( [ 'Project' , 'Folder' , 'File' ] , ids ) #NEWLINE# return