def tearDown(self): ids = [] for taxi in models.Taxi.query.all(): redis_store.delete('taxi:{}'.format(taxi.id)) for k, v in list(current_app.config.items()): if not k.startswith('REDIS'): continue redis_store.delete(v) current_app.extensions['sqlalchemy'].db.session.remove() current_app.extensions['sqlalchemy'].db.drop_all() current_app.extensions['sqlalchemy'].db.get_engine(self.app).dispose()
def tearDown(self): ids = [] for taxi in Taxi.query.all(): redis_store.delete('taxi:{}'.format(taxi.id)) for k, v in current_app.config.iteritems(): if not k.startswith('REDIS'): continue redis_store.delete(v) current_app.extensions['sqlalchemy'].db.session.remove() current_app.extensions['sqlalchemy'].db.drop_all() current_app.extensions['sqlalchemy'].db.get_engine(self.app).dispose() current_app.extensions['dogpile_cache'].invalidate_all_regions()
def tearDown(self): ids = [] for taxi in Taxi.query.all(): redis_store.delete('taxi:{}'.format(taxi.id)) ids.append(taxi.id) for i in ids: redis_store.zrem('geoindex', i) db.session.remove() db.drop_all() db.get_engine(self.app).dispose() for r in regions.values(): r.invalidate() index_zupc.index_zupc = None
def tearDown(self): ids = [] for taxi in Taxi.query.all(): redis_store.delete('taxi:{}'.format(taxi.id)) redis_store.delete('geoindex') redis_store.delete('timestamps') current_app.extensions['sqlalchemy'].db.session.remove() current_app.extensions['sqlalchemy'].db.drop_all() current_app.extensions['sqlalchemy'].db.get_engine(self.app).dispose() current_app.extensions['dogpile_cache'].invalidate_all_regions()
def test_get_taxis_lon_lat_missing_redis_value(self): taxi_id = self.add() redis_store.delete('taxi:{}'.format(taxi_id)) r = self.get('/taxis/?lat=2.3&lon=48.7') self.assert200(r) assert len(r.json['data']) == 0