<s> from collections import OrderedDict <EOL> from zerotest . request import Request <EOL> from zerotest . utils . generator_helper import ( <EOL> get_name_from_request , <EOL> dict_to_param_style_code <EOL> ) <EOL> INVALID_CHARS = ( <EOL> '<STR_LIT:*>' , <EOL> '<STR_LIT:->' , <EOL> '<STR_LIT:#>' , <EOL> '<STR_LIT:/>' , <EOL> '<STR_LIT:.>' <EOL> ) <EOL> def test_get_name_from_request ( ) : <EOL> req = Request ( path = '<STR_LIT:/>' , method = '<STR_LIT:GET>' ) <EOL> assert get_name_from_request ( req ) == '<STR_LIT>' <EOL> req = Request ( path = '<STR_LIT>' , method = '<STR_LIT>' ) <EOL> assert get_name_from_request ( req ) == '<STR_LIT>' <EOL> for invalid_char in INVALID_CHARS : <EOL> assert ( <EOL> get_name_from_request ( <EOL> Request ( <EOL> path = '<STR_LIT>' . format ( invalid_char ) , <EOL> method = '<STR_LIT:GET>' <EOL> ) <EOL> ) == '<STR_LIT>' <EOL> ) <EOL> def test_dict_to_param_style_code ( ) : <EOL> test_dict = OrderedDict ( ) <EOL> test_dict [ '<STR_LIT>' ] = '<STR_LIT:A>' <EOL> test_dict [ '<STR_LIT>' ] = '<STR_LIT:C>' <EOL> assert dict_to_param_style_code ( test_dict ) == "<STR_LIT>" </s>
