#NEWLINE# def verifyNonPresentKey( self ) : #NEWLINE# #INDENT# "\n        Set up a test to verify a key that isn't present.  Return a 3-tuple of\n        the UI, a list set up to collect the result of the verifyHostKey call,\n        and the sample L{KnownHostsFile} being used.\n\n        This utility method avoids returning a L{Deferred}, and records results\n        in the returned list instead, because the events which get generated\n        here are pre-recorded in the 'ui' object.  If the L{Deferred} in\n        question does not fire, the it will fail quickly with an empty list.\n        " #NEWLINE# hostsFile = self . loadSampleHostsFile ( ) #NEWLINE# absentKey = Key . fromString ( thirdSampleKey ) #NEWLINE# ui = FakeUI ( ) #NEWLINE# l = [ ] #NEWLINE# d = hostsFile . verifyHostKey ( ui , 'sample-host.example.com' , '4.3.2.1' , absentKey ) #NEWLINE# d . addBoth ( l . append ) #NEWLINE# self . assertEqual ( [ ] , l ) #NEWLINE# self . assertEqual ( ui . promptText , "The authenticity of host 'sample-host.example.com (4.3.2.1)' can't be established.\nRSA key fingerprint is 89:4e:cc:8c:57:83:96:48:ef:63:ad:ee:99:00:4c:8f.\nAre you sure you want to continue connecting (yes/no)? " ) #NEWLINE# return ( ui , l , hostsFile )