def test_low_fare_search(self): flights = Flights(self.api_key) origin = 'NCE' destination = 'LAS' duration = '4--10' resp = flights.low_fare_search(origin=origin, destination=destination, departure_date=self.departure_date, return_date=self.return_date, duration=duration) self.assertTrue(len(resp) > 0)
def test_inspiration_search(self): flights = Flights(self.api_key) origin = 'BKK' departure_date = self.departure_date return_date = self.return_date max_price = 200 resp = flights.inspiration_search( origin=origin, departure_date="{departure_date}--{return_date}".format( departure_date=departure_date, return_date=return_date), max_price=max_price) self.assertTrue(len(resp) > 0)
def test_low_fare_search(self): flights = Flights(self.api_key) origin = 'NCE' destination = 'LAS' duration = '4--10' resp = flights.low_fare_search( origin=origin, destination=destination, departure_date=self.departure_date, return_date=self.return_date, duration=duration) self.assertTrue(len(resp) > 0)
def test_low_fare_search(self): flights = Flights(self.api_key) origin = "NCE" destination = "LAS" duration = "4--10" resp = flights.low_fare_search( origin=origin, destination=destination, departure_date=self.departure_date, return_date=self.return_date, duration=duration, ) self.assertTrue(len(resp) > 0)
def test_extensive_search(self): flights = Flights(self.api_key) origin = 'NCE' destination = 'LAS' departure_date = self.departure_date return_date = self.return_date duration = '4--10' resp = flights.extensive_search( origin=origin, destination=destination, departure_date="{departure_date}--{return_date}".format( departure_date=departure_date, return_date=return_date), duration=duration) print(resp) self.assertTrue(len(resp) > 0)
class InspiredFlights: def __init__(self): self.flights = Flights('s0XN9NBwpcEGmc9cL0NpSKs9rh5FRIpV') def where_can_i_fly(self, origin, budget): resp = self.flights.inspiration_search( origin=origin, departure_date="2015-11-20--2015-11-22", max_price=budget) with open('acodes.pickle', 'rb') as fh: resp['acodes'] = pickle.load(fh) return resp
def test_auto_complete(self): flights = Flights(self.api_key) resp = flights.auto_complete(term='Ban') self.assertTrue(len(resp) > 0)
def test_auto_complete(self): flights = Flights(self.api_key) resp = flights.auto_complete(term="Ban") self.assertTrue(len(resp) > 0)
def __init__(self): self.flights = Flights('s0XN9NBwpcEGmc9cL0NpSKs9rh5FRIpV')