本文整理汇总了Python中DBManager.DBManager.printNodes方法的典型用法代码示例。如果您正苦于以下问题:Python DBManager.printNodes方法的具体用法?Python DBManager.printNodes怎么用?Python DBManager.printNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.printNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TESTS
# 需要导入模块: from DBManager import DBManager [as 别名]
# 或者: from DBManager.DBManager import printNodes [as 别名]
#---------------------------------------------------------------------------------------------------------#
print "(========)NODE FUNCTION TESTS(========)"
#---------------------------------------------------------------------------------------------------------#
print "(=) Creating nodes"
d1 = db.createNode(dev1)
d2 = db.createNode(dev2)
d3 = db.createNode(dev3);
if d1 == -1 or d2 == -1 or d3 == -1:
print "\t(-) Node Creation failed."
else:
print "\t(+) Nodes created."
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing displayNodes function"
print "(=) List of all nodes"
db.printNodes()
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing creation of existing node"
try:
dx = db.createNode(dev1)
print "\t(-) Existing Node Creation Test Failed."
except:
print "\t(+) Existing Node Creation Test Passed."
#---------------------------------------------------------------------------------------------------------#
print "(=) activateNode Test"
print "(=) activating device=%s" % dev2
db.activateNode(dev2, ses)
print "\t(+) Activated, printing all nodes in %s" % ses
nodes = db.getNodes(ses)
for node in nodes:
print node