3.2. Step - 01 : Initial structure¶
To run behave, we need the following directory structure:
. |-- features | |-- steps | | `-- steps_addition.py | |-- environment.py | `-- simple-addition.feature `-- libmath.py
The contents of the files as under for the time being.
This is the file would eventually have the logic want to test. The contents of the file as as under.
# libmath.py # Empty for time being
This file has the BDD Tests.
# features/sample-addition.feature Feature: Simple Addition Showcase simple addition for the BDD Book. Scenario: Addition of single digit numbers Given I have '1' and '3' When I add them Then The result must be '4' Scenario: Addition of double digit numbers Given I have '70' and '29' When I add them Then The result must be '99'
This file would have (in later chapters) hooks/common implementation.
# environment.py # Empty for time being
This file is mapping between
libmath.py. We will add implementation in this file, in later chapters.
# features/steps/steps_addition.py # Empty for time being