def __init__(self, prompt=":> ", quitChar='\\'): self.prompt = prompt self.quitChar = quitChar self.mainMenu = """ {} Exit Prompt 1 Create Contact 2 Edit Contact 3 Delete Contact 4 Show Contact @Main{}""".format(quitChar, prompt) contactDb = ContactsDb('localhost', 'root', '1234', 'contacts_orm', 'contacts') Contact.connect(contactDb) pass
def setUp(self): cdb = ContactsDb(HOST, USERNAME, PASSWORD, DBNAME, TABLE) Contact.connect(cdb) testContact.save()
def testWrongPasswordForConnect(self): self.assertRaises( OperationalError, ContactsDb(HOST, USERNAME, 'wrongpassword', DBNAME, TABLE).connect)
def testDbConnect(self): self.assertTrue( ContactsDb(HOST, USERNAME, PASSWORD, DBNAME, TABLE).connect()) pass