def test_set_metadata_by_generate(self):
     dbUtil = DbUtil(engine=DummyEngine(), metadata=DummyMetadata())
     component.provideUtility(dbUtil, IDbUtil, name='unittest')
     db = DBConnection('unittest')
     db.set_metadata_by_generate('schema_name', dummyFunc)
     metadata = db.get_metadata()
     self.assertEqual(metadata, dummyFunc())
 def test_set_metadata_by_generate(self):
     dbUtil = DbUtil(engine=DummyEngine(), metadata=DummyMetadata())
     component.provideUtility(dbUtil, IDbUtil, name='unittest')
     db = DBConnection('unittest')
     db.set_metadata_by_generate('schema_name', dummyFunc)
     metadata = db.get_metadata()
     self.assertEqual(metadata, dummyFunc())
 def test_get_metadata(self):
     dbUtil = DbUtil(engine=DummyEngine(), metadata=DummyMetadata())
     component.provideUtility(dbUtil, IDbUtil, name='unittest')
     db = DBConnection('unittest')
     self.assertIsInstance(db.get_metadata(), DummyMetadata)
 def test_get_metadata(self):
     dbUtil = DbUtil(engine=DummyEngine(), metadata=DummyMetadata())
     component.provideUtility(dbUtil, IDbUtil, name='unittest')
     db = DBConnection('unittest')
     self.assertIsInstance(db.get_metadata(), DummyMetadata)