コード例 #1
0
ファイル: core.py プロジェクト: JordanAupetit/lkc-bdx
 def get_current_opt_parent_topmenu(self):
     """ Return the current option's first menu position or
         Return False if no option is selected"""
     if self.has_option_selected() is False:
         return False
     return utility.get_index_menu_option(self.cursor,
                                          self.items,
                                          self.top_menus)
コード例 #2
0
ファイル: unit_tests.py プロジェクト: JordanAupetit/lkc-bdx
    def test_get_index_menu_option(self):
        """
        Returns the index of the top menu where there is an option 
        Returns 0 if the option is not in a menu 
        Returns a number between 1 and the number of top menus
        """

        for i in range(len(items) - 1):
            index = utility.get_index_menu_option(i, items, top_menus)
            self.assertTrue(index >= 0)
            self.assertTrue(index <= len(top_menus))