当前位置: 首页>>代码示例>>Python>>正文


Python Module.changeStateComplete方法代码示例

本文整理汇总了Python中module.Module.changeStateComplete方法的典型用法代码示例。如果您正苦于以下问题:Python Module.changeStateComplete方法的具体用法?Python Module.changeStateComplete怎么用?Python Module.changeStateComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在module.Module的用法示例。


在下文中一共展示了Module.changeStateComplete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from module import Module [as 别名]
# 或者: from module.Module import changeStateComplete [as 别名]
def main():
	failcount = 0
	print('Testing Module creation')
	testmodule = Module('testmodule')
	if( isinstance(testmodule, Module) ):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Testmodule creation test: ' + testresult)
	print('Testmod name: ' + testmodule.getName())
	if( testmodule.getName() == 'testmodule'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Testmod name test: ' + testresult + '\n')

	testmodstate = testmodule.getState()
	print('Testmod initial state: ' + testmodstate)
	if( testmodstate == 'INCOMPLETE'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Testmod initialize test: ' + testresult + '\n')

	print('Testing change states')

	print('Change to INCOMPLETE')
	testmodule.changeStateIncomplete()
	print('Testmod state: ' + testmodstate)
	if(testmodule.getState() == 'INCOMPLETE'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Test: ' + testresult + '\n')

	print('Change to COMPLETE')
	testmodule.changeStateComplete()
	print('Testmod state: ' + testmodstate)
	if(testmodule.getState() == 'COMPLETE'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Test: ' + testresult + '\n')

	print('Change to STRIKE')
	testmodule.changeStateStrike()
	print('Testmod state: ' + testmodstate)
	if(testmodule.getState() == 'STRIKE'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Test: ' + testresult + '\n')

	print('Change to INCOMPLETE')
	testmodule.changeStateIncomplete()
	print('Testmod state: ' + testmodstate)
	if(testmodule.getState() == 'INCOMPLETE'):
		testresult = 'PASS'
	else:
		testresult = 'FAIL'
		failcount += 1
	print('Test: ' + testresult + '\n')

	print ("Tests finished running.")
	print ("Tests failed: " + str(failcount))
开发者ID:Saucyz,项目名称:explode,代码行数:73,代码来源:testmod.py


注:本文中的module.Module.changeStateComplete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。