예제 #1
0
    def import_from_redis(self):
        keys = self.redis.keys()
        weekend_keys = filter(lambda key: key.decode()[0] != "w", keys)
        flights = []

        for key in weekend_keys:
            flights.append(flight.Flight(key, self.redis.get(key)))

        return flights
예제 #2
0
def flight_instance():
    return flight.Flight(b"2018-01-01BCNSXF20:00", b"20.00")
예제 #3
0
def weekend():
    return [
        flight.Flight(b"2018-01-01BCNSXF20:00", b'20.00'),
        flight.Flight(b"2018-01-03SXFBCN20:00", b'20.00')
    ]