def OnNewUserKeyword(self, event): dlg = UserKeywordNameDialog(self.controller) if dlg.ShowModal() == wx.ID_OK: self.controller.execute(AddKeyword(dlg.get_name(), dlg.get_args())) dlg.Destroy()
def test_arguments_are_returned(self): kw_ctrl = file_controller().create_keyword('Keyword it is') dlg = UserKeywordNameDialog(kw_ctrl) assert_equal(dlg.get_args(), '')
def test_creation(self): kw_ctrl = file_controller().create_keyword('Keyword it is') dlg = UserKeywordNameDialog(kw_ctrl) assert_equal(dlg.get_name(), '')
def test_execute(self): kw_ctrl = file_controller().create_keyword('Keyword it is', '${a1} | ${a2}') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) wx.CallAfter(dlg.EndModal, wx.ID_OK) assert_equal(dlg.execute(), None)
def test_get_empty_args(self): kw_ctrl = file_controller().create_keyword('Keyword it is') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) assert_equal(dlg.get_args(), '')
def test_get_args_item_is_not_none(self): kw_ctrl = file_controller().create_keyword('Keyword it is', '${a1} | ${a2}') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) assert_equal(dlg.get_args(), '${a1} | ${a2}')
def test_args_validator(self): kw_ctrl = file_controller().create_keyword('Keyword it is', '${a1} | ${a2}') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) validator = get_dlg_validators(dlg)[1] assert_true(isinstance(validator, ArgumentsValidator))
def test_validators(self): kw_ctrl = file_controller().create_keyword('Keyword it is', '${a1} | ${a2}') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) assert_equal(len(get_dlg_validators(dlg)), 2)
def test_get_title(self): kw_ctrl = file_controller().create_keyword('Keyword it is', '${a1} | ${a2}') dlg = UserKeywordNameDialog(kw_ctrl, item=kw_ctrl.data) assert_equal(dlg.GetTitle(), UserKeywordNameDialog._title)