def create_qs_graph(self): cpe = MyClassPatternExtractor(Base._decl_class_registry) qs = QuadStorage(self.qsname, cpe, nsm=nsm, add_default=False) g = GraphQuadMapPattern(self.graphname, qs, None, None) qs.alias_manager = cpe # Hack cpe.add_class(A, g) cpe.add_class(B, g) cpe.add_class(C, g) cpe.add_class(D, g) return qs, g, cpe
def tearDown(self): qs = QuadStorage(self.qsname, None, nsm=nsm) try: print(qs.drop(session, True)) for table in ("test_d", "test_c", "test_b", "test_a"): session.execute('delete from test..'+table) session.commit() except Exception as e: print(e) session.rollback()
def drop_storage(self, storage_name, force=True): qs = QuadStorage(storage_name, None, nsm=self.nsm) try: qs.drop(self.session, force) except Exception as e: print e
def prepare_storage(self, quad_storage_name, imported=None): cpe = AssemblClassPatternExtractor(Base._decl_class_registry) qs = QuadStorage(quad_storage_name, cpe, imported, False, nsm=self.nsm) return qs, cpe