4712 def __unittestProject(self): |
4712 def __unittestProject(self): |
4713 """ |
4713 """ |
4714 Private slot for displaying the unittest dialog and run the current |
4714 Private slot for displaying the unittest dialog and run the current |
4715 project. |
4715 project. |
4716 """ |
4716 """ |
|
4717 prog = None |
4717 fn = self.project.getMainScript(True) |
4718 fn = self.project.getMainScript(True) |
4718 if fn: |
4719 if fn: |
4719 tfn = Utilities.getTestFileName(fn) |
4720 tfn = Utilities.getTestFileName(fn) |
4720 if os.path.exists(tfn): |
4721 if os.path.exists(tfn): |
4721 prog = tfn |
4722 prog = tfn |
4722 else: |
4723 else: |
4723 prog = fn |
4724 prog = fn |
4724 else: |
|
4725 E5MessageBox.critical( |
|
4726 self, |
|
4727 self.tr("Unittest Project"), |
|
4728 self.tr( |
|
4729 "There is no main script defined for the" |
|
4730 " current project. Aborting")) |
|
4731 return |
|
4732 |
4725 |
4733 self.__unittest() |
4726 self.__unittest() |
4734 self.unittestDialog.setProjectMode(True) |
4727 self.unittestDialog.setProjectMode(True) |
4735 self.unittestDialog.insertProg(prog) |
4728 self.unittestDialog.insertProg(prog) |
4736 self.utRestartAct.setEnabled(False) |
4729 self.utRestartAct.setEnabled(False) |