localization - How to handle multilingual data in lettuce? -
i wrote *.feature file , step.py lettuce work correctly, when put persian data *.feature file, stops working.
this feature file:
feature: computefactorial in order play lettuce beginners we'll implement factorial scenario: factorial of 0 given have number 0 when compute factorial see number علی
and step.py:
from lettuce import * @step('i have number (\d+)') def have_the_number(step, number): world.number = int(number) @step('i compute factorial') def compute_its_factorial(step): world.number = factorial(world.number) @step('i see number (\w+)') def check_number(step, expected): #expected = int(expected) assert true def factorial(number): return -1
how can this?
if want use string
need quotation marks. feature file should this.
scenario: factorial of 0 given have number 0 when compute factorial see number "علی"
and in step file:
... @step('i see number "(\w+)"') def check_number(step, expected): #expected = int(expected) assert true ...
hope helps. step definition using string on main page of documentation
Comments
Post a Comment