本文整理汇总了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"