def testRecovery(self):
        k = self.dbm._encode("key1")
        f = open(os.path.join(self.path, k + ".rpl"), "wb")
        f.write("value")
        f.close()

        k2 = self.dbm._encode("key2")
        f = open(os.path.join(self.path, k2), "wb")
        f.write("correct")
        f.close()
        f = open(os.path.join(self.path, k2 + ".rpl"), "wb")
        f.write("wrong")
        f.close()

        f = open(os.path.join(self.path, "aa.new"), "wb")
        f.write("deleted")
        f.close()

        dbm = dirdbm.DirDBM(self.path)
        assert dbm["key1"] == "value"
        assert dbm["key2"] == "correct"
        assert not glob.glob(os.path.join(self.path, "*.new"))
        assert not glob.glob(os.path.join(self.path, "*.rpl"))
Return the number of words remaining after the preview.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_dirdbm.py/DirDbmTestCase.testRecovery--crossover with--dataset/ETHPy150Open Fantomas42/django-blog-zinnia/zinnia/preview.py/HTMLPreview.remaining_words