def test_parse_checkout_success(self): data = self.sample_data("checkout_success.xml") parser = CheckoutResponseParser() parsed = parser.process_all(data) assert isinstance(parsed, LoanInfo) eq_(Identifier.AXIS_360_ID, parsed.identifier_type) eq_(datetime.datetime(2015, 8, 11, 18, 57, 42), parsed.end_date) assert isinstance(parsed.fulfillment_info, FulfillmentInfo) eq_("http://axis360api.baker-taylor.com/Services/VendorAPI/GetAxisDownload/v2?blahblah", parsed.fulfillment_info.content_link)
def test_parse_checkout_success(self): data = self.sample_data("checkout_success.xml") parser = CheckoutResponseParser() parsed = parser.process_all(data) assert isinstance(parsed, LoanInfo) eq_(Identifier.AXIS_360_ID, parsed.identifier_type) eq_(datetime.datetime(2015, 8, 11, 18, 57, 42), parsed.end_date) assert isinstance(parsed.fulfillment_info, FulfillmentInfo) eq_( "http://axis360api.baker-taylor.com/Services/VendorAPI/GetAxisDownload/v2?blahblah", parsed.fulfillment_info.content_link)
def test_parse_not_found_on_remote(self): data = self.sample_data("not_found_on_remote.xml") parser = CheckoutResponseParser(None) assert_raises(NotFoundOnRemote, parser.process_all, data)
def test_parse_already_checked_out(self): data = self.sample_data("already_checked_out.xml") parser = CheckoutResponseParser(None) assert_raises(AlreadyCheckedOut, parser.process_all, data)