def test_conv_str_choices_valid():
 param = inspect.Parameter('foo', inspect.Parameter.POSITIONAL_ONLY)
 converted = argparser.type_conv(param, str, 'val1', str_choices=['val1', 'val2'])
 assert (converted == 'val1')

def test_conv_str_choices_valid ( ) : param = inspect . Parameter ( 'foo' , inspect . Parameter . POSITIONAL_ONLY ) converted = argparser . type_conv ( param , str , 'val1' , str_choices = [ 'val1' , 'val2' ] ) assert ( converted == 'val1' )
calling str type with str_choices and valid value .