本文整理匯總了Python中DBManager.DBManager.createContact方法的典型用法代碼示例。如果您正苦於以下問題:Python DBManager.createContact方法的具體用法?Python DBManager.createContact怎麽用?Python DBManager.createContact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.createContact方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TESTS
# 需要導入模塊: from DBManager import DBManager [as 別名]
# 或者: from DBManager.DBManager import createContact [as 別名]
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"