Created
November 10, 2014 13:15
-
-
Save zsoldosp/dd779b5e71a3a76f5fbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Showing off behave | |
Scenario: Run a simple test | |
Given we have behave installed | |
When we implement 5 tests | |
Then behave will test them for us! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from behave import given, when, then, step | |
@given('we have behave installed') | |
def step_impl(context): | |
pass | |
@when('we implement {number:d} tests') | |
def step_impl(context, number): # -- NOTE: number is converted into integer | |
assert number > 1 or number == 0 | |
context.tests_count = number | |
@then('behave will test them for us!') | |
def step_impl(context): | |
assert context.failed is False | |
assert context.tests_count >= 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment