本文整理汇总了Python中DBManager.DBManager.printSessions方法的典型用法代码示例。如果您正苦于以下问题:Python DBManager.printSessions方法的具体用法?Python DBManager.printSessions怎么用?Python DBManager.printSessions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager.DBManager
的用法示例。
在下文中一共展示了DBManager.printSessions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TESTS
# 需要导入模块: from DBManager import DBManager [as 别名]
# 或者: from DBManager.DBManager import printSessions [as 别名]
except SessionError as se:
print "\t(+) Failure of getSession Test Passed. Error Caught:", se.msg
#---------------------------------------------------------------------------------------------------------#
print "(=) Setting period of %s to 1 day." % ses
db.setSessionPeriod(ses, 1)
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing Failure of setSessionPeriod function"
try:
db.setSessionPeriod(ses, 'invalid duration')
print "\t(-) Failure of setSessionPeriod Test Failed"
except ValueError as ve:
print "\t(+) Failure of setSessionPeriod Test Passed. Error Caught:", ve
#---------------------------------------------------------------------------------------------------------#
print "(=) Testing getSessions function"
print "(=) List of all sessions"
db.printSessions()
#---------------------------------------------------------------------------------------------------------#
#---------------------------------------------------------------------------------------------------------#
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"