python – 如何断言Pyke中的负面事实?
作者:互联网
假设我有事实档案:
code_in_git(a)
code_in_git(b)
code_in_git(c)
build_on_disk(a)
build_on_disk(c)
我想断言规则“if code_in_git($branch)而不是build_on_disk($branch),创建fact needs_build($branch)”.我怎样才能做到这一点?
解决方法:
好吧,似乎我可以用notany声明它们:
no_build_on_disk
foreach
deploy.code_in_git($branch)
notany
deploy.build_on_disk($branch)
assert
deploy.needs_build($branch)
标签:python,declarative,pyke 来源: https://codeday.me/bug/20190609/1207208.html