This commit was manufactured by cvs2svn to create tag 'r23b1-mac'.
[python/dscho.git] / Lib / test / test_urllibnet.py
blob3af2491ecc58d41aaf0354354ab064efd868be60
1 #!/usr/bin/env python
3 import unittest
4 from test import test_support
6 import socket
7 import urllib2
8 import sys
10 class URLTimeoutTest(unittest.TestCase):
12 TIMEOUT = 10.0
14 def setUp(self):
15 socket.setdefaulttimeout(self.TIMEOUT)
17 def tearDown(self):
18 socket.setdefaulttimeout(None)
20 def testURLread(self):
21 f = urllib2.urlopen("http://www.python.org/")
22 x = f.read()
24 def test_main():
25 test_support.requires('network')
27 suite = unittest.TestSuite()
28 suite.addTest(unittest.makeSuite(URLTimeoutTest))
29 test_support.run_suite(suite)
31 if __name__ == "__main__":
32 test_main()