コード例 #1
0
    def _test_get_action_handler(my):
        search_type = "unittest/person"

        # get the definition directly
        view = "edit"
        config = WidgetConfigView.get_by_search_type(search_type, view)
        action_handler = config.get_action_handler("drop")
        my.assertEquals("DropElementAction", action_handler)
        action_handler = config.get_action_handler("code")
        my.assertEquals("", action_handler)

        config = WidgetConfigView.get_by_search_type(search_type, 'test')
        action_handler = config.get_action_handler("drop")
        my.assertEquals("", action_handler)

        # get_by_elemnet_names will get it
        config = WidgetConfigView.get_by_element_names(search_type, ['drop'],
                                                       'test')
        action_handler = config.get_action_handler("drop")
        my.assertEquals("DropElementAction", action_handler)
        options = config.get_action_options("drop")
        my.assertEquals("path_test", options.get('path'))
コード例 #2
0
ファイル: widget_config_test.py プロジェクト: mincau/TACTIC
    def _test_get_action_handler(self):
        search_type = "unittest/person"


        # get the definition directly
        view = "edit"
        config = WidgetConfigView.get_by_search_type(search_type, view)
        action_handler = config.get_action_handler("drop")
        self.assertEquals("DropElementAction", action_handler)
        action_handler = config.get_action_handler("code")
        self.assertEquals("", action_handler)

        config = WidgetConfigView.get_by_search_type(search_type, 'test')
        action_handler = config.get_action_handler("drop")
        self.assertEquals("", action_handler)

        # get_by_elemnet_names will get it
        config = WidgetConfigView.get_by_element_names(search_type, ['drop'], 'test')
        action_handler = config.get_action_handler("drop")
        self.assertEquals("DropElementAction", action_handler)
        options = config.get_action_options("drop")
        self.assertEquals("path_test", options.get('path'))