本文整理匯總了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 []