'L{KnownHostsFile.save} will write out a new file with any entries
that have been added.'

def test_savingAddsEntry(self):

    path = self.pathWithContent((sampleHashedLine + otherSamplePlaintextLine))
    knownHostsFile = KnownHostsFile.fromPath(path)
    newEntry = knownHostsFile.addHostKey('some.example.com', Key.fromString(thirdSampleKey))
    expectedContent = ((((((((sampleHashedLine + otherSamplePlaintextLine) + HashedEntry.MAGIC) + b2a_base64(newEntry._hostSalt).strip()) + '|') + b2a_base64(newEntry._hostHash).strip()) + '    ssh-rsa    ') + thirdSampleEncodedKey) + '\n')
    self.assertEqual(3, expectedContent.count('\n'))
    knownHostsFile.save()
    self.assertEqual(expectedContent, path.getContent())
