def test_false(self): """Change extension line edit should be disabled when ext_chk is not checked""" with patch('PySide2.QtCore.QSettings'): gui = GUI() gui.ext_chk.setChecked(True) gui.ext_line_edit.setEnabled(True) QTest.mouseClick(gui.ext_chk, Qt.LeftButton) self.assertEqual(False, gui.ext_line_edit.isEnabled())
def test_true(self): """Add suffix line edit should be enabled when suff_chk is checked""" with patch('PySide2.QtCore.QSettings'): gui = GUI() gui.suff_chk.setChecked(False) gui.suff_line_edit.setEnabled(False) QTest.mouseClick(gui.suff_chk, Qt.LeftButton) self.assertEqual(True, gui.suff_line_edit.isEnabled())
def test_false(self): """Old name and new name line edits should be disabled when rename_chk is not checked""" with patch('PySide2.QtCore.QSettings'): gui = GUI() gui.rename_chk.setChecked(True) gui.rename_old_line_edit.setEnabled(True) gui.rename_new_line_edit.setEnabled(True) QTest.mouseClick(gui.rename_chk, Qt.LeftButton) self.assertEqual(False, gui.rename_old_line_edit.isEnabled()) self.assertEqual(False, gui.rename_new_line_edit.isEnabled())
__appname__ = "Easy File Renamer" __module__ = "main" __author__ = "Jose Ivan Lopez Romo" __copyright__ = "Copyright 2018" __license__ = "MIT" __version__ = "1.0.0" __email__ = "*****@*****.**" if __name__ == "__main__": logging.basicConfig( handlers=[logging.FileHandler(LOG_FILE_PATH, encoding='utf-8')], level=logging.INFO, format="%(asctime)s -- %(levelname)s -- %(message)s") QCoreApplication.setApplicationName("EasyFileRenamer") QCoreApplication.setApplicationVersion("1.0") QCoreApplication.setOrganizationName("EasyFileRenamer") QCoreApplication.setOrganizationDomain("www.ivanlopezr.com") logging.info("--- APPLICATION STARTED ---") QApplication.setStyle("fusion") app = QApplication(sys.argv) form = GUI() form.show() sys.exit(app.exec_())