def test_multi_passenger_check_in(self):
        fake_event = {
            'passengers': [
                {"firstName": "GEORGE", "lastName": "BUSH"},
                {"firstName": "LAURA", "lastName": "BUSH"},
            ],
            'confirmation_number': 'ABC123',
            'check_in_times': {
                'remaining': [],
                'next': '2017-05-12T08:55:00-05:00'
            },
            'email': '*****@*****.**'
        }

        responses.add(
            responses.POST,
            'https://mobile.southwest.com/api/extensions/v1/mobile/reservations/'
            'record-locator/ABC123/boarding-passes',
            json=util.load_fixture('check_in_success'),
            status=200
        )

        responses.add(
            responses.POST,
            'https://mobile.southwest.com/api/extensions/v1/mobile/record-locator/'
            'ABC123/operation-infos/mobile-boarding-pass/notifications',
            json=util.load_fixture('email_boarding_pass'),
            status=200
        )

        assert(check_in(fake_event, None))
Пример #2
0
    def test_cancelled_check_in(self):
        fake_event = {
            'first_name': "GEORGE",
            'last_name': "BUSH",
            'confirmation_number': 'ABC123',
            'check_in_times': {
                'remaining': [],
                'next': '2017-05-12T08:55:00-05:00'
            },
            'email': '*****@*****.**'
        }

        responses.add(
            responses.POST,
            'https://mobile.southwest.com/api/extensions/v1/mobile/reservations/'
            'record-locator/ABC123/boarding-passes',
            json=util.load_fixture('check_in_reservation_cancelled'),
            status=404)

        assert (check_in(fake_event, None) == False)
 def test_failed_check_in(self):
     with self.assertRaises(exceptions.SouthwestAPIError):
         check_in(self.fake_event, None)
 def test_cancelled_check_in(self):
     with self.assertRaises(exceptions.ReservationNotFoundError):
         check_in(self.fake_event, None)
 def test_check_in(self):
     assert(check_in(self.fake_event, None))