'Consecutive sudo() calls should not incur a blank line in-between'

@mock_streams('both')
@server(pubkeys=True, responses={'oneliner': 'result', 'twoliner': 'result1\nresult2'})
def test_consecutive_sudos_should_not_have_blank_line(self):

    env.password = None
    env.no_agent = env.no_keys = True
    env.key_filename = CLIENT_PRIVKEY
    with password_response((CLIENT_PRIVKEY_PASSPHRASE, PASSWORDS[USER]), silent=False):
        sudo('oneliner')
        sudo('twoliner')
    expected = ("\n[%(prefix)s]    sudo:    oneliner\n[%(prefix)s]    Login    password    for    '%(user)s':    \n[%(prefix)s]    out:    sudo    password:\n[%(prefix)s]    out:    Sorry,    try    again.\n[%(prefix)s]    out:    sudo    password:    \n[%(prefix)s]    out:    result\n[%(prefix)s]    sudo:    twoliner\n[%(prefix)s]    out:    sudo    password:\n[%(prefix)s]    out:    result1\n[%(prefix)s]    out:    result2\n" % {'prefix': env.host_string, 'user': env.user})
    eq_(sys.stdall.getvalue(), expected[1:])
