def test_ZODB_persistence(self): """ Should be able to init without these values """ c = Configure() fname = 'ZODB.fs' c['rdf.source'] = 'ZODB' c['rdf.store_conf'] = fname Configureable.default = c d = Data() try: d.openDatabase() g = make_graph(20) for x in g: d['rdf.graph'].add(x) d.closeDatabase() d.openDatabase() self.assertEqual(20, len(list(d['rdf.graph']))) d.closeDatabase() except Exception: traceback.print_exc() self.fail("Bad state") delete_zodb_data_store(fname)
def test_Sleepycat_persistence(self): """ Should be able to init without these values """ c = Configure() fname = 'Sleepycat_store' c['rdf.source'] = 'Sleepycat' c['rdf.store_conf'] = fname Configureable.default = c d = Data() try: d.openDatabase() g = make_graph(20) for x in g: d['rdf.graph'].add(x) d.closeDatabase() d.openDatabase() self.assertEqual(20, len(list(d['rdf.graph']))) d.closeDatabase() except Exception: traceback.print_exc() self.fail("Bad state") subprocess.call("rm -rf "+fname, shell=True)