Freshen is an acceptance testing framework for Python . uses the (mostly) same syntax as Cucumber. Why copy Cucumber? - Because it works and lots of people use it. Why use Nose? - Because it works and lots of people use it and it already does many useful things. No need to spend time in re-implementing coverage, profiling, test discovery, and command like processing again. Freshen supports 30 languages, exactly the same as cucumber, since the "language" file was borrowed from the cucumber project. As long as your .feature files respect the syntax, the person in charge of writing the acceptance tests may write it down.
Update tool info HERE
Scenario: Divide regular numbers Given I have entered 3 into the calculator And I have entered 2 into the calculator When I press divide Then the result should be 1.5 on the screen
Scenario Outline: Add two numbers Given I have entered <input_1> into the calculator And I have entered <input_2> into the calculator When I press <button> Then the result should be <output> on the screen Examples: | input_1 | input_2 | button | output | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 |
from freshen import * import calculator @Before def before(sc): scc.calc = calculator.Calculator() scc.result = None @Given("I have entered (\d+) into the calculator") def enter(num): scc.calc.push(int(num)) @When("I press (\w+)") def press(button): op = getattr(scc.calc, button) scc.result = op() @Then("the result should be (.*) on the screen") def check_result(value): assert_equal(str(scc.result), value)
Points: 0
You voted ‘up’
View MANUFACTURERS Wallboard
Theme by Danetsoft and Danang Probo Sayekti