Anonymous avatar Anonymous committed 25cf0ac

...

Comments (0)

Files changed (3)

 """Package-wide variables:
 """
 LICENSE_KEY = None;
-HTTP_PROXY = None
 LOCALE = "us"
 VERSION = "2007-04-04"
 OPTIONS = {}
    )
 
 
-
 class AWSException(Exception) : 
 	'''Base class for all AWS exceptions'''
 	pass
 	"""Send the query url and return the DOM
 	
 	Exception is raised if there is errors"""
-	u = urllib.FancyURLopener(HTTP_PROXY)
+	u = urllib.FancyURLopener()
 	usock = u.open(url)
 	dom = minidom.parse(usock)
 	usock.close()

tests/exception-test.py

 	def testOptionPut(self):
 		self.assertRaises( ecs.BadOption, ecs.setOptions, {'foo': 3} )
 
+
 	def testExactParameterRequirement(self):
 		pass
 

tests/main-test.py

 		self.assertEqual(el[0].Shipments[0].DeliveryMethod, "Mail")
 
 
+class SocketTest(unittest.TestCase):
+	def setUp(self):
+		ecs.setLicenseKey("1MGVS72Y8JF7EC7JDZG2");
+
+	def testTimeout(self):
+		import socket
+		dto = socket.getdefaulttimeout()
+		socket.setdefaulttimeout(0.05)
+		self.assertRaises( IOError, ecs.TransactionLookup, "104-1867480-8536729")
+		socket.setdefaulttimeout(dto)
+
+
 if __name__ == "__main__" :
 	unittest.main()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.