'L{KnownHostsFile.hasHostKey} returns C{True} when a key for the given
hostname is present in the file, even if it is only added to the file
after the L{KnownHostsFile} instance is initialized.'

def test_hasLaterAddedKey(self):

    key = Key.fromString(sampleKey)
    entry = PlainEntry(['brandnew.example.com'], key.sshType(), key, '')
    hostsFile = self.loadSampleHostsFile()
    with hostsFile.savePath.open('a') as hostsFileObj:
        hostsFileObj.write((entry.toString() + '\n'))
    self.assertEqual(True, hostsFile.hasHostKey('brandnew.example.com', key))
