Beispiel #1
0
 def test_rename_resu_occurrence_in_case_of_double_definition(self):
     old_name = 'Keyword In Both Resources'
     new_name = 'FiiFaa'
     for kw in [k for k in self.resu.keywords if k.name == old_name]:
         self.resu.execute(
             RenameKeywordOccurrences(kw.name, new_name, NullObserver(),
                                      kw.info))
         assert_equals(kw.name, new_name)
Beispiel #2
0
 def test_rename_embedded_arguments_keyword_with_another_embedded_arguments_keyword(self):
     old_name = '2nd embedded ${args} keyword'
     new_name = '2nd embedded args keyword with ${trailing args}'
     self.assert_occurrences(self.ts3, old_name, 2)
     self.assert_occurrences(self.ts3, new_name, 0)
     self.ts3.execute(RenameKeywordOccurrences(old_name, new_name, NullObserver()))
     self.assert_occurrences(self.ts3, old_name, 1)
     self.assert_occurrences(self.ts3, new_name, 1)
Beispiel #3
0
 def test_rename_embedded_arguments_keyword_but_dont_rename_occurrences(self):
     old_name = 'embedded ${args} keyword'
     new_name = 'unembedded keyword'
     self.assert_occurrences(self.ts3, old_name, 2)
     self.assert_occurrences(self.ts3, new_name, 0)
     self.ts3.execute(RenameKeywordOccurrences(old_name, new_name, NullObserver()))
     self.assert_occurrences(self.ts3, old_name, 1)
     self.assert_occurrences(self.ts3, new_name, 1)
Beispiel #4
0
    def rename_keyword(self):
        class Observer(object):
            def notify(self, *args):
                pass

            def finish(self, *args):
                pass

        self._macro_execute(RenameKeywordOccurrences('foo', 'bar', Observer()))
 def OnRenameKeyword(self, event):
     old_name = self._current_cell_value()
     if not old_name.strip() or variablematcher.is_variable(old_name):
         return
     new_name = wx.GetTextFromUser('New name', 'Rename Keyword',
                                   default_value=old_name)
     if new_name:
         self._execute(RenameKeywordOccurrences(
             old_name, new_name, RenameProgressObserver(self.GetParent())))
Beispiel #6
0
 def _rename(self, original_name, new_name, source, usage):
     self.test_ctrl.execute(
         RenameKeywordOccurrences(original_name, new_name, NullObserver()))
     assert_occurrence(self.test_ctrl, new_name, source, usage)
Beispiel #7
0
 def _create_rename_command(self, new_name):
     return RenameKeywordOccurrences(self.controller.name, new_name,
                                     RenameProgressObserver(self.GetParent().GetParent()),
                                     self.controller.info)