def OnNewTestCase(self, event): dlg = TestCaseNameDialog(self.controller) if dlg.ShowModal() == wx.ID_OK: self.controller.execute(AddTestCase(dlg.get_name())) dlg.Destroy()
def test_creation(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl) assert_equal(dlg.get_name(), '')
def test_case_validator(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl, item=test_ctrl.data) validator = get_dlg_validators(dlg)[0] assert_true(isinstance(validator, TestCaseNameValidator))
def test_validators(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl, item=test_ctrl.data) assert_equal(len(get_dlg_validators(dlg)), 1)
def test_get_title(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl, item=test_ctrl.data) assert_equal(dlg.GetTitle(), TestCaseNameDialog._title)
def test_execute(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl, item=test_ctrl.data) wx.CallAfter(dlg.EndModal, wx.ID_YES) assert_equal(dlg.execute(), None)
def test_get_name_item_is_not_none(self): test_ctrl = file_controller().create_test('A test') dlg = TestCaseNameDialog(test_ctrl, item=test_ctrl.data) assert_equal(dlg.get_name(), 'A test')