def test_verifyInvalidKey(self):
        """
        Verifying an invalid key should return a L{Deferred} which fires with a
        L{HostKeyChanged} failure.
        """
        hostsFile = self.loadSampleHostsFile()
        wrongKey = Key.fromString(thirdSampleKey)
        ui = FakeUI()
        hostsFile.addHostKey(b"1.2.3.4", Key.fromString(sampleKey))
        d = hostsFile.verifyHostKey(
            ui, b"www.twistedmatrix.com", b"1.2.3.4", wrongKey)
        return self.assertFailure(d, HostKeyChanged)

        Verifying an invalid key should return a L{Deferred} which fires with a
        L{HostKeyChanged} failure.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_knownhosts.py