def test_bfod_check(self): """ ensure the use of check works on disk bloom """ filename = "tmp.blm" blm = BloomFilterOnDisk(filename, 10, 0.05) blm.add("this is a test") blm.add("this is another test") self.assertEqual(blm.check("this is a test"), True) self.assertEqual(blm.check("this is another test"), True) self.assertEqual(blm.check("this is yet another test"), False) self.assertEqual(blm.check("this is not another test"), False) blm.close() os.remove(filename)
def test_bfod_check(self): ''' ensure the use of check works on disk bloom ''' filename = 'tmp.blm' blm = BloomFilterOnDisk(filename, 10, 0.05) blm.add('this is a test') blm.add('this is another test') self.assertEqual(blm.check('this is a test'), True) self.assertEqual(blm.check('this is another test'), True) self.assertEqual(blm.check('this is yet another test'), False) self.assertEqual(blm.check('this is not another test'), False) blm.close() os.remove(filename)
def test_bfod_check(self): ''' ensure the use of check works on disk bloom ''' filename = 'tmp.blm' blm = BloomFilterOnDisk(filename, 10, 0.05) blm.add('this is a test') blm.add('this is another test') self.assertEqual(blm.check('this is a test'), True) self.assertEqual(blm.check('this is another test'), True) self.assertEqual(blm.check('this is yet another test'), False) self.assertEqual(blm.check('this is not another test'), False) blm.close() os.remove(filename)
def test_bfod_check(self): """ensure the use of check works on disk bloom""" with NamedTemporaryFile(dir=os.getcwd(), suffix=".blm", delete=DELETE_TEMP_FILES) as fobj: blm = BloomFilterOnDisk(fobj.name, 10, 0.05) blm.add("this is a test") blm.add("this is another test") self.assertEqual(blm.check("this is a test"), True) self.assertEqual(blm.check("this is another test"), True) self.assertEqual(blm.check("this is yet another test"), False) self.assertEqual(blm.check("this is not another test"), False) blm.close()