'L{KnownHostsFile.addHostKey} adds a new L{HashedEntry} to the host
file, and returns it.'

def test_addHostKey(self):

    hostsFile = self.loadSampleHostsFile()
    aKey = Key.fromString(thirdSampleKey)
    self.assertEqual(False, hostsFile.hasHostKey('somewhere.example.com', aKey))
    newEntry = hostsFile.addHostKey('somewhere.example.com', aKey)
    self.assertEqual(20, len(newEntry._hostSalt))
    self.assertEqual(True, newEntry.matchesHost('somewhere.example.com'))
    self.assertEqual(newEntry.keyType, 'ssh-rsa')
    self.assertEqual(aKey, newEntry.publicKey)
    self.assertEqual(True, hostsFile.hasHostKey('somewhere.example.com', aKey))
