def test_explicit_groups(self):

        action_sets = [
            ActionSet(
                menus = [
                    Menu(name='&File', path='MenuBar'),
                    Menu(name='&Edit', path='MenuBar'),
                    Menu(name='&Tools', path='MenuBar'),
                    Menu(name='&Help', path='MenuBar')
                ],
            ),

            ActionSet(
                menus = [
                    Menu(name='&New', path='MenuBar/File', group='NewGroup'),
                ],
            ),

            ActionSet(
                actions = [
                    Action(
                        class_name = 'Exit',
                        path       = 'MenuBar/File',
                        group      = 'ExitGroup'
                    ),
                ]
            ),

            ActionSet(
                groups = [
                    Group(
                        id   = 'ExitGroup',
                        path = 'MenuBar/File'
                    ),

                    Group(
                        id    = 'SaveGroup',
                        path  = 'MenuBar/File',
                        after = 'NewGroup'
                    ),

                    Group(
                        id     = 'NewGroup',
                        path   = 'MenuBar/File',
                        before = 'ExitGroup'
                    ),

                ]
            ),

        ]

        # Create a builder containing the action set.
        builder = DummyActionManagerBuilder(action_sets=action_sets)

        # Create a menu bar manager for the 'MenuBar'.
        menu_manager = builder.create_menu_bar_manager('MenuBar')

        # Make sure that all of the menus were added the the 'additions' group
        # of the menubar.
        self.assertEqual(1, len(menu_manager.groups))

        additions = menu_manager.find_group('additions')
        ids = [item.id for item in additions.items]
        self.assertEqual(['File', 'Edit', 'Tools', 'Help'], ids)

        # Make sure the 'File' menu has got 3 groups, 'NewGroup', 'ExitGroup'
        # and 'additions' (and in that order!).
        menu = menu_manager.find_item('File')
        self.assertEqual(4, len(menu.groups))

        ids = [group.id for group in menu.groups]
        self.assertEqual(
            ['NewGroup', 'SaveGroup', 'ExitGroup', 'additions'], ids
        )

        # Make sure the 'New' sub-menu got added to the 'NewGroup' group
        # of the 'File' menu.
        menu = menu_manager.find_item('File')
        group = menu.find_group('NewGroup')

        self.assertEqual('New', group.items[0].id)

        # Make sure the 'Exit' action got added to the 'ExitGroup' group
        # of the 'File' menu.
        menu = menu_manager.find_item('File')
        group = menu.find_group('ExitGroup')

        self.assertEqual('Exit', group.items[0].id)

        return
explicit groups
dataset/ETHPy150Open enthought/envisage/envisage/ui/action/tests/action_manager_builder_test_case.py/ActionManagerBuilderTestCase.test_explicit_groups