本文整理汇总了Python中app.master.build.Build.validate_update_params方法的典型用法代码示例。如果您正苦于以下问题:Python Build.validate_update_params方法的具体用法?Python Build.validate_update_params怎么用?Python Build.validate_update_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.master.build.Build
的用法示例。
在下文中一共展示了Build.validate_update_params方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_validate_update_params_for_cancelling_build
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import validate_update_params [as 别名]
def test_validate_update_params_for_cancelling_build(self):
build = Build(BuildRequest({}))
success, response = build.validate_update_params({'status': 'canceled'})
self.assertTrue(success, "Correct status update should report success")
self.assertEqual({}, response, "Error response should be empty")
示例2: test_validate_update_params_rejects_bad_keys
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import validate_update_params [as 别名]
def test_validate_update_params_rejects_bad_keys(self):
build = Build(BuildRequest({}))
success, response = build.validate_update_params({'badkey': 'foo'})
self.assertFalse(success, "Bad status update reported success")
self.assertEqual({'error': "Key (badkey) is not in list of allowed keys (status)"}, response,
"Error response not expected")
示例3: test_validate_update_params_rejects_bad_params
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import validate_update_params [as 别名]
def test_validate_update_params_rejects_bad_params(self):
build = Build(BuildRequest({}))
success, response = build.validate_update_params({'status': 'foo'})
self.assertFalse(success, "Bad status update reported success")
self.assertEqual({'error': "Value (foo) is not in list of allowed values (['canceled']) for status"}, response,
"Error response not expected")