'Verifying an invalid key should return a L{Deferred} which fires with a
L{HostKeyChanged} failure.'

def test_verifyInvalidKey(self):

    hostsFile = self.loadSampleHostsFile()
    wrongKey = Key.fromString(thirdSampleKey)
    ui = FakeUI()
    hostsFile.addHostKey('1.2.3.4', Key.fromString(sampleKey))
    d = hostsFile.verifyHostKey(ui, 'www.twistedmatrix.com', '1.2.3.4', wrongKey)
    return self.assertFailure(d, HostKeyChanged)
