def test_location_autosuggest_json(self):
        carhire_service = CarHire(self.api_key, response_format='json')

        self.result = carhire_service.location_autosuggest(
            market='UK', currency='GBP', locale='en-GB', query='Kuala').parsed

        self.assertTrue('results' in self.result)
        self.assertTrue(len(self.result['results']) > 0)
    def test_location_autosuggest_xml(self):
        carhire_service = CarHire(self.api_key, response_format='xml')

        self.result = carhire_service.location_autosuggest(
            market='DE', currency='EUR', locale='de-DE', query='Berlin').parsed

        self.assertTrue(None != self.result.find('./Results'))
        self.assertTrue(
            len(self.result.findall('./Results/HotelResultDto')) > 0)
    def test_location_autosuggest_xml(self):
        carhire_service = CarHire(self.api_key, response_format="xml")

        self.result = carhire_service.location_autosuggest(
            market="DE", currency="EUR", locale="de-DE", query="Berlin"
        ).parsed

        self.assertTrue(None != self.result.find("./Results"))
        self.assertTrue(len(self.result.findall("./Results/HotelResultDto")) > 0)
    def test_location_autosuggest_json(self):
        carhire_service = CarHire(self.api_key, response_format="json")

        self.result = carhire_service.location_autosuggest(
            market="UK", currency="GBP", locale="en-GB", query="Kuala"
        ).parsed

        self.assertTrue("results" in self.result)
        self.assertTrue(len(self.result["results"]) > 0)
    def test_location_autosuggest_xml(self):
        carhire_service = CarHire(self.api_key, response_format='xml')

        self.result = carhire_service.location_autosuggest(
            market='DE',
            currency='EUR',
            locale='de-DE',
            query='Berlin').parsed

        self.assertIsNotNone(self.result.find('./Results'))
        self.assertTrue(len(self.result.findall('./Results/HotelResultDto')) > 0)
    def test_location_autosuggest_json(self):
        carhire_service = CarHire(self.api_key, response_format='json')

        self.result = carhire_service.location_autosuggest(
            market='UK',
            currency='GBP',
            locale='en-GB',
            query='Kuala').parsed

        self.assertTrue('results' in self.result)
        self.assertTrue(len(self.result['results']) > 0)
    def test_create_session(self):
        """
        http://partners.api.skyscanner.net/apiservices/carhire/liveprices/v2/{market}/{currency}/{locale}/{pickupplace}/{dropoffplace}/{pickupdatetime}/{dropoffdatetime}/{driverage}?apiKey={apiKey}&userip={userip}
        YYYY-MM-DDThh:mm
        """
        carhire_service = CarHire(self.api_key)

        poll_url = carhire_service.create_session(market='UK',
                                                  currency='GBP',
                                                  locale='en-GB',
                                                  pickupplace='LHR-sky',
                                                  dropoffplace='LHR-sky',
                                                  pickupdatetime=self.pickup,
                                                  dropoffdatetime=self.dropoff,
                                                  driverage='30',
                                                  userip='175.156.244.174')

        self.assertTrue(poll_url)
    def test_create_session(self):
        """
        http://partners.api.skyscanner.net/apiservices/carhire/liveprices/v2/{market}/{currency}/{locale}/{pickupplace}/{dropoffplace}/{pickupdatetime}/{dropoffdatetime}/{driverage}?apiKey={apiKey}&userip={userip}
        YYYY-MM-DDThh:mm
        """
        carhire_service = CarHire(self.api_key)

        poll_url = carhire_service.create_session(
            market='UK',
            currency='GBP',
            locale='en-GB',
            pickupplace='LHR-sky',
            dropoffplace='LHR-sky',
            pickupdatetime=self.pickup,
            dropoffdatetime=self.dropoff,
            driverage='30',
            userip='175.156.244.174')

        self.assertTrue(poll_url)
    def test_get_result_json(self):
        """
        http://partners.api.skyscanner.net/apiservices/carhire/liveprices/v2/{market}/{currency}/{locale}/{pickupplace}/{dropoffplace}/{pickupdatetime}/{dropoffdatetime}/{driverage}?apiKey={apiKey}&userip={userip}
        YYYY-MM-DDThh:mm
        """
        carhire_service = CarHire(self.api_key, response_format='json')

        self.result = carhire_service.get_result(
            market='UK',
            currency='GBP',
            locale='en-GB',
            pickupplace='LHR-sky',
            dropoffplace='LHR-sky',
            pickupdatetime=self.pickup,
            dropoffdatetime=self.dropoff,
            driverage='30',
            userip='175.156.244.174').parsed

        self.assertTrue('cars' in self.result)
        self.assertTrue('websites' in self.result)
    def test_get_result_json(self):
        """
        http://partners.api.skyscanner.net/apiservices/carhire/liveprices/v2/{market}/{currency}/{locale}/{pickupplace}/{dropoffplace}/{pickupdatetime}/{dropoffdatetime}/{driverage}?apiKey={apiKey}&userip={userip}
        YYYY-MM-DDThh:mm
        """
        carhire_service = CarHire(self.api_key, response_format='json')

        self.result = carhire_service.get_result(
            market='UK',
            currency='GBP',
            locale='en-GB',
            pickupplace='LHR-sky',
            dropoffplace='LHR-sky',
            pickupdatetime=self.pickup,
            dropoffdatetime=self.dropoff,
            driverage='30',
            userip='175.156.244.174').parsed

        self.assertTrue('cars' in self.result)
        self.assertTrue('websites' in self.result)
    def test_get_result_json(self):
        """
        http://partners.api.skyscanner.net/apiservices/carhire/liveprices/v2/{market}/{currency}/{locale}/{pickupplace}/{dropoffplace}/{pickupdatetime}/{dropoffdatetime}/{driverage}?apiKey={apiKey}&userip={userip}
        YYYY-MM-DDThh:mm
        """
        carhire_service = CarHire(self.api_key, response_format="json")

        self.result = carhire_service.get_result(
            market="UK",
            currency="GBP",
            locale="en-GB",
            pickupplace="LHR-sky",
            dropoffplace="LHR-sky",
            pickupdatetime=self.pickup,
            dropoffdatetime=self.dropoff,
            driverage="30",
            userip="175.156.244.174",
        ).parsed

        self.assertTrue("cars" in self.result)
        self.assertTrue("websites" in self.result)