def test_old_format_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://api-extensions.southwest.com/v1/mobile/reservations/' 'record-locator/ABC123/boarding-passes', json=util.load_fixture('check_in_success'), status=200) responses.add( responses.POST, 'https://api-extensions.southwest.com/v1/mobile/record-locator/' 'ABC123/operation-infos/mobile-boarding-pass/notifications', json=util.load_fixture('email_boarding_pass'), status=200) result = handler.check_in(fake_event, None)
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://api-extensions.southwest.com/v1/mobile/reservations/' 'record-locator/ABC123/boarding-passes', json=util.load_fixture('check_in_reservation_cancelled'), status=404) assert (handler.check_in(fake_event, None) == False)
def test_not_last_check_in(self): fake_event = { 'passengers': [ { "firstName": "GEORGE", "lastName": "BUSH" }, { "firstName": "LAURA", "lastName": "BUSH" }, ], 'confirmation_number': 'ABC123', 'check_in_times': { 'remaining': ['2017-05-13T15:10:00-05:00'], 'next': '2017-05-12T08:55:00-05:00' }, 'email': '*****@*****.**' } responses.add( responses.POST, 'https://api-extensions.southwest.com/v1/mobile/reservations/' 'record-locator/ABC123/boarding-passes', json=util.load_fixture('check_in_success'), status=200) responses.add( responses.POST, 'https://api-extensions.southwest.com/v1/mobile/record-locator/' 'ABC123/operation-infos/mobile-boarding-pass/notifications', json=util.load_fixture('email_boarding_pass'), status=200) try: result = handler.check_in(fake_event, None) assert False, "NotLastCheckIn exception was not raised" except exceptions.NotLastCheckIn: pass