4762 def __unittestProject(self): |
4762 def __unittestProject(self): |
4763 """ |
4763 """ |
4764 Private slot for displaying the unittest dialog and run the current |
4764 Private slot for displaying the unittest dialog and run the current |
4765 project. |
4765 project. |
4766 """ |
4766 """ |
|
4767 prog = None |
4767 fn = self.project.getMainScript(True) |
4768 fn = self.project.getMainScript(True) |
4768 if fn: |
4769 if fn: |
4769 tfn = Utilities.getTestFileName(fn) |
4770 tfn = Utilities.getTestFileName(fn) |
4770 if os.path.exists(tfn): |
4771 if os.path.exists(tfn): |
4771 prog = tfn |
4772 prog = tfn |
4772 else: |
4773 else: |
4773 prog = fn |
4774 prog = fn |
4774 else: |
|
4775 E5MessageBox.critical( |
|
4776 self, |
|
4777 self.tr("Unittest Project"), |
|
4778 self.tr( |
|
4779 "There is no main script defined for the" |
|
4780 " current project. Aborting")) |
|
4781 return |
|
4782 |
4775 |
4783 self.__unittest() |
4776 self.__unittest() |
4784 self.unittestDialog.setProjectMode(True) |
4777 self.unittestDialog.setProjectMode(True) |
4785 self.unittestDialog.insertProg(prog) |
4778 self.unittestDialog.insertProg(prog) |
4786 self.utRestartAct.setEnabled(False) |
4779 self.utRestartAct.setEnabled(False) |