blob: 03728e1e0ce05f29fc055c5b31819a48969c346f [file] [log] [blame]
Skip Montanaro89feabc2003-03-30 04:54:24 +00001#!/usr/bin/env python
2
3import unittest
4from test import test_support
5
6import socket
7import urllib2
8import sys
9
10class URLTimeoutTest(unittest.TestCase):
11
12 TIMEOUT = 10.0
13
14 def setUp(self):
15 socket.setdefaulttimeout(self.TIMEOUT)
16
17 def tearDown(self):
18 socket.setdefaulttimeout(None)
19
20 def testURLread(self):
21 f = urllib2.urlopen("http://www.python.org/")
22 x = f.read()
23
24def test_main():
25 test_support.requires('network')
Walter Dörwald21d3a322003-05-01 17:45:56 +000026 test_support.run_unittest(URLTimeoutTest)
Skip Montanaro89feabc2003-03-30 04:54:24 +000027
28if __name__ == "__main__":
29 test_main()