本文整理汇总了Python中pytest_bdd.when方法的典型用法代码示例。如果您正苦于以下问题:Python pytest_bdd.when方法的具体用法?Python pytest_bdd.when怎么用?Python pytest_bdd.when使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pytest_bdd
的用法示例。
在下文中一共展示了pytest_bdd.when方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_allrevisions
# 需要导入模块: import pytest_bdd [as 别名]
# 或者: from pytest_bdd import when [as 别名]
def _check_allrevisions(mediawiki, db):
prop = {"ids", "flags", "timestamp", "user", "userid", "size", "sha1", "contentmodel", "comment", "content", "tags"}
api_params = {
"list": "allrevisions",
"arvprop": "|".join(prop),
"arvlimit": "max",
}
api_list = list(mediawiki.api.list(api_params))
db_list = list(db.query(list="allrevisions", arvprop=prop))
# FIXME: hack until we have per-page grouping like MediaWiki
api_revisions = []
for page in api_list:
for rev in page["revisions"]:
rev["pageid"] = page["pageid"]
rev["ns"] = page["ns"]
rev["title"] = page["title"]
api_revisions.append(rev)
api_revisions.sort(key=lambda item: item["revid"], reverse=True)
api_list = api_revisions
# FIXME: WTF, MediaWiki does not restore rev_parent_id when undeleting...
# https://phabricator.wikimedia.org/T183375
for rev in db_list:
del rev["parentid"]
for rev in api_list:
del rev["parentid"]
assert db_list == api_list
示例2: passon
# 需要导入模块: import pytest_bdd [as 别名]
# 或者: from pytest_bdd import when [as 别名]
def passon():
""" A container to pass information from when to then """
return []