def testConnect(self): self.assertTrue(helper.dbConnect())
import sys from PyQt5.Qt import * from logindialog import LoginDialog from mainwindow import MainWindow import helper if __name__ == '__main__': app = QApplication(sys.argv) helper.dbConnect() loginDialog = LoginDialog() isAuth = False result = -1 while not isAuth: result = loginDialog.exec_() if result == LoginDialog.Success or LoginDialog.Rejected: isAuth = True else: isAuth = False if result == LoginDialog.Success: w = MainWindow() w.show() app.exec_() sys.exit(-1)
import sys from PySide.QtGui import QApplication from logindialog import LoginDialog from mainwindow import MainWindow import helper if __name__ == "__main__": a = QApplication(sys.argv) helper.dbConnect() loginDialog = LoginDialog() isAuth = False result = -1 while not isAuth: result = loginDialog.exec_() if result == LoginDialog.Success or result == LoginDialog.Rejected: isAuth = True else: isAuth = False if result == LoginDialog.Success: w = MainWindow() w.show() a.exec_() sys.exit(-1)
def testAuth(self): helper.dbConnect() auth = Auth() self.assertEqual(auth.doLogin("eko", "password"), True)
def testConnect(self): qApp = QCoreApplication(sys.argv) self.assertTrue(helper.dbConnect())
def testAuth(self): qApp = QCoreApplication(sys.argv) helper.dbConnect() auth = Auth() self.assertEqual(auth.doLogin("eko", "password"), True)
def testSignup(self): qApp = QCoreApplication(sys.argv) helper.dbConnect() auth = Auth() self.assertEqual(auth.doSignUp("pxj", "password"), False) self.assertEqual(auth.doSignUp("ipxj", "password"), True)
def testAuth(self): # self.assertEqual("actual", "expected") qApp = QCoreApplication(sys.argv) helper.dbConnect() auth = Auth() self.assertEqual(auth.doLogin("pxj", "password"), True)