<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from behave import given , then , step <EOL> from hamcrest import assert_that , equal_to <EOL> import six <EOL> @ step ( u'<STR_LIT>' ) <EOL> def step_set_behave_context_parameter_to ( context , param_name , value ) : <EOL> setattr ( context , param_name , value ) <EOL> @ step ( u'<STR_LIT>' ) <EOL> def step_behave_context_parameter_exists ( context , param_name ) : <EOL> assert hasattr ( context , param_name ) <EOL> @ step ( u'<STR_LIT>' ) <EOL> def step_behave_context_parameter_not_exists ( context , param_name ) : <EOL> assert not hasattr ( context , param_name ) <EOL> @ given ( u'<STR_LIT>' ) <EOL> def given_behave_context_has_parameter_named ( context , param_name ) : <EOL> step_behave_context_parameter_exists ( context , param_name ) <EOL> @ given ( u'<STR_LIT>' ) <EOL> def given_behave_context_does_not_have_parameter_named ( context , param_name ) : <EOL> step_behave_context_parameter_not_exists ( context , param_name ) <EOL> @ step ( u'<STR_LIT>' ) <EOL> def step_behave_context_should_have_parameter_named ( context , param_name ) : <EOL> step_behave_context_parameter_exists ( context , param_name ) <EOL> @ step ( u'<STR_LIT>' ) <EOL> def step_behave_context_should_not_have_parameter_named ( context , param_name ) : <EOL> step_behave_context_parameter_not_exists ( context , param_name ) <EOL> @ then ( u'<STR_LIT>' ) <EOL> def then_behave_context_should_contain_with_table ( context ) : <EOL> assert context . table , "<STR_LIT>" <EOL> for row in context . table . rows : <EOL> param_name = row [ "<STR_LIT>" ] <EOL> param_value = row [ "<STR_LIT>" ] <EOL> if param_value . startswith ( '<STR_LIT:">' ) and param_value . endswith ( '<STR_LIT:">' ) : <EOL> param_value = param_value [ <NUM_LIT:1> : - <NUM_LIT:1> ] <EOL> actual = six . text_type ( getattr ( context , param_name , None ) ) <EOL> assert hasattr ( context , param_name ) <EOL> assert_that ( actual , equal_to ( param_value ) ) <EOL> @ given ( u'<STR_LIT>' ) <EOL> def given_behave_context_contains_with_table ( context ) : <EOL> then_behave_context_should_contain_with_table ( context ) </s>
