TDD Implementing Step Definitions derived from Behave (Python) -


where put behave's implementation code not fail behave's tests? further need import or put code in code write linked feature file.

here excerpt feature file \steps\main.feature ...

feature: main program     program allows users create create , view development logs   scenario: user requests development logs particular user     given user has requested development logs given user     development logs user show 

and here implementation suggestions (that come running behave):

@given(u'user has requested development logs given user') def step_impl(context):     raise notimplementederror(u'step: given user has requested development logs given user')  @then(u'the development logs user show') def step_impl(context):     raise notimplementederror(u'step: development logs user show') 

i realise basic information nothing in documentation covers , although there lots of tutorial on google none of them cover this. assume basic.

the answer threefold:

  1. i raising not implemented error test failed.

  2. at top of python file needed include from behave import *.

  3. my python file needed directory called steps.

i worked out myself trial , error after looking @ answer python tdd directory structure.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -