'After using the default initializer for L{KnownHostsFile}, the first use
of L{KnownHostsFile.save} overwrites any existing contents in the save
path.'

def test_defaultInitializerClobbersExisting(self):

    path = self.pathWithContent(sampleHashedLine)
    hostsFile = KnownHostsFile(path)
    entry = hostsFile.addHostKey('www.example.com', Key.fromString(otherSampleKey))
    hostsFile.save()
    self.assertEqual([entry], list(hostsFile.iterentries()))
    self.assertEqual((entry.toString() + '\n'), path.getContent())
