def test_extract(self): new_kw_name = 'New Keyword' self._exec(ExtractKeyword(new_kw_name, '', (0, 1))) self._verify_step(0, new_kw_name) self._verify_step_number_change(-1) assert_true(self._ctrl.dirty) assert_equal(self._new_keyword.name, new_kw_name)
def test_extract_with_for_loop(self): new_kw_name = 'New Keyword with For Loop' self._exec( ExtractKeyword(new_kw_name, '', (self._data_row(FOR_LOOP_HEADER), self._data_row(FOR_LOOP_STEP2)))) self._verify_step(self._data_row(FOR_LOOP_HEADER), new_kw_name) self._verify_step_number_change(-2) assert_true(self._ctrl.dirty) assert_equal(self._new_keyword.name, new_kw_name)
def not_implmented_test_extract_from_for_loop(self): new_kw_name = 'Flooo' self._exec( ExtractKeyword(new_kw_name, '', (self._data_row(FOR_LOOP_STEP1), self._data_row(FOR_LOOP_STEP2)))) self._verify_step_number_change(-1) assert_true(self._ctrl.dirty) assert_equal(self._new_keyword.name, new_kw_name) assert_equal(self._steps[self._data_row(FOR_LOOP_STEP1)].as_list(), ['', new_kw_name])
def OnExtractKeyword(self, event): dlg = UserKeywordNameDialog(self._controller) if dlg.ShowModal() == wx.ID_OK: name, args = dlg.get_value() rows = self.selection.topleft.row, self.selection.bottomright.row self._execute(ExtractKeyword(name, args, rows))
def extract_keyword(self): first_row = self._rand_row() self._macro_execute( ExtractKeyword( 'foo', '', [first_row, first_row + self._random.randint(1, 10)]))
def not_implemented_test_undoing_extract(self): new_kw_name = 'New Keyword' self._exec(ExtractKeyword(new_kw_name, '', (0, 1))) self._exec(Undo()) self._verify_step_number_change(0)