Ejemplo n.º 1
0
    def test_sort_and_restore_keywords(self):
        resource_ctrl = self._get_ctrl_by_name(
            datafilereader.SIMPLE_TEST_SUITE_RESOURCE_NAME)

        # Capture keyword list before sorting
        original_keywords = resource_ctrl.get_keyword_names()
        list_for_undo_comparison = original_keywords[:]

        # Sort the list
        resource_ctrl.execute(SortKeywords())
        sorted_keywords = resource_ctrl.get_keyword_names()
        original_keywords.sort()
        assert_equals(original_keywords, sorted_keywords)

        # Undo sorting
        resource_ctrl.execute(Undo())
        restored_list = resource_ctrl.get_keyword_names()
        assert_equals(restored_list, list_for_undo_comparison)

        # Redo sorting
        resource_ctrl.execute(Redo())
        keywords_after_redo = resource_ctrl.get_keyword_names()
        assert_equals(keywords_after_redo, sorted_keywords)
Ejemplo n.º 2
0
 def OnSortKeywords(self, event):
     """Sorts the keywords inside the treenode"""
     self.controller.execute(SortKeywords())