def test_bulk_dump(self): """Test Xco2.bulk_dump()""" from src.formatdata import bulk_dump print('#### TEST5 ####') session2 = dbProxy.create_session(db='test', engine=self.engine) util_truncate_table(session2, [Xco2, Areas]) bulk_dump(create_generator_from_dataset(self.dataset, 8)) rows = self.session.query(Xco2).count() try: self.assertEqual(rows, 8) print('PASSED') except AssertionError: print('FAILED')
def test_bulk_dump(self): """Test Xco2.bulk_dump()""" from src.formatdata import bulk_dump print('#### TEST5 ####') session2 = dbProxy.create_session(db='test', engine=self.engine) util_truncate_table(session2, [Xco2, Areas]) bulk_dump( create_generator_from_dataset(self.dataset, 8) ) rows = self.session.query(Xco2).count() try: self.assertEqual(rows, 8) print('PASSED') except AssertionError: print('FAILED')
def tearDown(self): # if you want to keep the data in the db to make test using psql, # comment the line below util_truncate_table(self.session, [Xco2, Areas]) del self.session pass
def tearDown(self): util_truncate_table(self.session, table=[Xco2, Areas]) pass
def tearDown(self): util_truncate_table(self.session, [Xco2, Areas]) del self.session pass