本文整理汇总了Python中client_test_lib.Bootstrap.unexpected_response_failure方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrap.unexpected_response_failure方法的具体用法?Python Bootstrap.unexpected_response_failure怎么用?Python Bootstrap.unexpected_response_failure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client_test_lib.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.unexpected_response_failure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_content_type
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import unexpected_response_failure [as 别名]
def test_content_type(self):
bootstrap = Bootstrap()
bootstrap.ztps.set_config_response(content_type='text/plain')
bootstrap.start_test()
try:
self.failUnless(bootstrap.unexpected_response_failure())
self.failIf(bootstrap.error)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise_exception(assertion)
finally:
bootstrap.end_test()
示例2: test_status
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import unexpected_response_failure [as 别名]
def test_status(self):
bootstrap = Bootstrap()
bootstrap.ztps.set_config_response(status=201)
bootstrap.start_test()
try:
self.failUnless(bootstrap.unexpected_response_failure())
self.assertEquals(cli_log(), [])
self.failIf(bootstrap.error)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise assertion
finally:
bootstrap.end_test()
示例3: test_content_type
# 需要导入模块: from client_test_lib import Bootstrap [as 别名]
# 或者: from client_test_lib.Bootstrap import unexpected_response_failure [as 别名]
def test_content_type(self):
bootstrap = Bootstrap()
bootstrap.ztps.set_config_response()
bootstrap.ztps.set_node_check_response()
bootstrap.ztps.set_definition_response(
actions=[{'action' : 'test_action'}])
bootstrap.ztps.set_action_response('test_action', print_action(),
content_type='test/plain')
bootstrap.start_test()
try:
self.failUnless(bootstrap.eapi_node_information_collected())
self.failUnless(bootstrap.unexpected_response_failure())
self.failIf(bootstrap.error)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
raise assertion
finally:
bootstrap.end_test()