我的行为步骤或多或少是一组变化。 我想给你一些建议。你知道吗
示例:
@given('a cookie with sprinkles')
def cookie_with_sprinkles():
"""Given a cookie with sprinkles"""
...
@given('a cookie with icing')
...
@given('a cookie in wrapping')
...
使用测试步骤
Given a cookie with icing
我想说
Undefined step 'Given a cookie with icing'
Steps available with 'a cookie' are:
Given a cookie with sprinkles
Given a cookie with icing
Given a cookie in wrapping
我希望在某个地方硬编码一个模式 “cookie”以及到实现cookie步骤的函数的映射。 我很想重新使用--steps目录中的功能,但是只使用doc字符串就可以了。你知道吗
谢谢!你知道吗
这实际上是不可能的,除非可能通过修补行为本身。不过,也许你可以这样做:
在这个检查之后,你可以调用另一个步骤,有很多方法可以处理超过这一点的事情,所以我将把这个留给你。你知道吗
相关问题 更多 >
编程相关推荐