print "(=) deleteNode Test" print "(=) deleting device=%s" % dev3 db.deleteNode(dev3) print "(=) deleting non-existent device." try: db.deleteNode('devu') print "\t(-) deleteNode Test Failed." except NodeError as ne: print "\t(+) deleteNode Test Passed. Error Caught: ", ne.msg #---------------------------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------------------------# print "(========)CONTACT FUNCTION TESTS(========)" #---------------------------------------------------------------------------------------------------------# print "(=) Creating contact" contID = db.createContact(cont1['fName'], cont1['lName'], cont1['email'], cont1['sms']) #---------------------------------------------------------------------------------------------------------# print "(=) Testing Failure of createContact function" try: db.createContact(fName=badfName) print "\t(-) Failure of createContact Test Failed" except ContactError as ce: print "\t(+) Failure of createContact Test Passed. Error Caught:", ce.msg try: db.createContact(lName=badlName) print "\t(-) Failure of createContact Test Failed" except ContactError as ce: print "\t(+) Failure of createContact Test Passed. Error Caught:", ce.msg try: db.createContact(email=bademail) print "\t(-) Failure of createContact Test Failed"