Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
 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)
Exemple #4
0
 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)