@mock_streams('stdout')
@with_patched_input(p)
def test_prompt_with_default():
 s = 'This is my prompt'
 d = 'default!'
 prompt(s, default=d)
 eq_(sys.stdout.getvalue(), ('%s [%s] ' % (s, d)))

@ mock_streams ( 'stdout' ) @ with_patched_input ( p ) def test_prompt_with_default ( ) : s = 'This is my prompt' d = 'default!' prompt ( s , default = d ) eq_ ( sys . stdout . getvalue ( ) , ( '%s [%s] ' % ( s , d ) ) )
prompt() appends given default value plus one space on either side .