def test_response_exists_for_sandbox(self): """Test that we get a response from ups xml server""" xml = """<?xml version="1.0" encoding="UTF-8"?> <checkout-shopping-cart xmlns="http://checkout.google.com/schema/2"> <shopping-cart> <items> <item> <item-name>HelloWorld 2GB MP3 Player</item-name> <item-description>HelloWorld, the simple MP3 player</item-description> <unit-price currency="USD">159.99</unit-price> <quantity>1</quantity> </item> </items> </shopping-cart> <checkout-flow-support> <merchant-checkout-flow-support> <shipping-methods> <flat-rate-shipping name="SuperShip Ground"> <price currency="USD">9.99</price> </flat-rate-shipping> </shipping-methods> </merchant-checkout-flow-support> </checkout-flow-support> </checkout-shopping-cart>""" response = pygcheckout.send_xml_data('https://sandbox.google.com/checkout/api/checkout/v2/merchantCheckout/Merchant/258193370883239',xml) self.assertNotEqual(response,'')
def test_no_response_for_random_url(self): """Test to see that the script gracefully exists if no url is present""" response = pygcheckout.send_xml_data('http://asdf2991911888.com','adsf') self.assertEqual(response,'The url: http://asdf2991911888.com is not responding.')