Esempio n. 1
0
 def setUp(self):
     self.cfg = Config()
     self.cfg.popcon_index = "test_data/.sample_pxi"
     self.cfg.popcon_dir = "test_data/popcon_dir"
     self.cfg.clusters_dir = "test_data/clusters_dir"
     # build old index for all tests
     shutil.rmtree(self.cfg.popcon_index,1)
     self.assertFalse(os.path.exists(self.cfg.popcon_index))
     # local variable, index will be closed before test
     pxi = PopconXapianIndex(self.cfg)
     self.assertEqual(pxi.get_metadata("old"),"")
     pxi.set_metadata("old","true")
Esempio n. 2
0
 def test_reindex(self):
     # force reindex with no clustering
     self.cfg.index_mode = "reindex"
     pxi = PopconXapianIndex(self.cfg)
     self.assertEqual(pxi.get_metadata("old"),"")
Esempio n. 3
0
 def test_load(self):
     # load the previously built index
     pxi = PopconXapianIndex(self.cfg)
     self.assertEqual(pxi.get_metadata("old"),"true")