'Check reject_unknown_hosts exception'

@server()
def test_host_not_in_known_hosts_exception(self):

    with settings(hide('everything'), password=None, reject_unknown_hosts=True, disable_known_hosts=True, abort_on_prompts=True):
        try:
            run('echo    foo')
        except NetworkError as exc:
            exp = "Server    '[127.0.0.1]:2200'    not    found    in    known_hosts"
            assert (str(exc) == exp), ('%s    !=    %s' % (exc, exp))
        else:
            raise AssertionError('Host    connected    without    valid    fingerprint.')
