def setUp(self): keynamehelper.set_prefix("uc06") self.redis = Redis(host=os.environ.get("REDIS_HOST", "localhost"), port=os.environ.get("REDIS_PORT", 6379), db=0, decode_responses=True) self.redis.flushdb() self.event_keys = self.create_events(EVENTS) self.customer_keys = self.create_customers(CUSTOMERS) self.event_key = self.event_keys[0] self.customer_key = self.customer_keys[0]
print "== Find venues within 20km of 'Makuhari Messe' on the 'Keiyo Line'" # Note: This only works if the member we are search for is on the # "Keiyo Line". For example, "Olympic Statdium" is not # on the "Keiyo Line" so would return zero results. print redis.georadiusbymember(geo_key, "Makuhari Messe", 20, "km", withdist=True) def main(): """ Main, used to call test cases for this use case""" from redisu.utils.clean import clean_keys global redis redis = StrictRedis(host=os.environ.get("REDIS_HOST", "localhost"), port=os.environ.get("REDIS_PORT", 6379), db=0) clean_keys(redis) # Performs the tests test_venue_search() test_event_search() test_transit_search() if __name__ == "__main__": keynamehelper.set_prefix("uc05") main()