Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(126285)

Side by Side Diff: Lib/test/test_urllib2net.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_unicodedata.py ('k') | Lib/test/test_uuid.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import unittest 1 import unittest
2 from test import support 2 from test import support
3 from test.test_urllib2 import sanepathname2url 3 from test.test_urllib2 import sanepathname2url
4 4
5 import os 5 import os
6 import socket 6 import socket
7 import urllib.error 7 import urllib.error
8 import urllib.request 8 import urllib.request
9 import sys 9 import sys
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 ## bauth = HTTPBasicAuthHandler() 142 ## bauth = HTTPBasicAuthHandler()
143 ## bauth.add_password('basic_test_realm', localhost, 'jhylton', 143 ## bauth.add_password('basic_test_realm', localhost, 'jhylton',
144 ## 'password') 144 ## 'password')
145 ## dauth = HTTPDigestAuthHandler() 145 ## dauth = HTTPDigestAuthHandler()
146 ## dauth.add_password('digest_test_realm', localhost, 'jhylton', 146 ## dauth.add_password('digest_test_realm', localhost, 'jhylton',
147 ## 'password') 147 ## 'password')
148 148
149 ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth]) 149 ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
150 150
151 @unittest.skipIf(ssl is None, 'test requires ssl module')
151 def test_urlwithfrag(self): 152 def test_urlwithfrag(self):
152 urlwith_frag = "http://www.pythontest.net/index.html#frag" 153 urlwith_frag = "http://www.pythontest.net/index.html#frag"
153 with support.transient_internet(urlwith_frag): 154 with support.transient_internet(urlwith_frag):
154 req = urllib.request.Request(urlwith_frag) 155 req = urllib.request.Request(urlwith_frag)
155 res = urllib.request.urlopen(req) 156 res = urllib.request.urlopen(req)
156 self.assertEqual(res.geturl(), 157 self.assertEqual(res.geturl(),
157 "http://www.pythontest.net/index.html#frag") 158 "http://www.pythontest.net/index.html#frag")
158 159
160 @unittest.skipIf(ssl is None, 'test requires ssl module')
159 def test_redirect_url_withfrag(self): 161 def test_redirect_url_withfrag(self):
160 redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/" 162 redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/"
161 with support.transient_internet(redirect_url_with_frag): 163 with support.transient_internet(redirect_url_with_frag):
162 req = urllib.request.Request(redirect_url_with_frag) 164 req = urllib.request.Request(redirect_url_with_frag)
163 res = urllib.request.urlopen(req) 165 res = urllib.request.urlopen(req)
164 self.assertEqual(res.geturl(), 166 self.assertEqual(res.geturl(),
165 "http://www.pythontest.net/elsewhere/#frag") 167 "http://www.pythontest.net/elsewhere/#frag")
166 168
167 def test_custom_headers(self): 169 def test_custom_headers(self):
168 url = "http://www.example.com" 170 url = "http://www.example.com"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 322
321 def test_ftp_timeout(self): 323 def test_ftp_timeout(self):
322 with support.transient_internet(self.FTP_HOST): 324 with support.transient_internet(self.FTP_HOST):
323 u = _urlopen_with_retry(self.FTP_HOST, timeout=60) 325 u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
324 self.addCleanup(u.close) 326 self.addCleanup(u.close)
325 self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) 327 self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
326 328
327 329
328 if __name__ == "__main__": 330 if __name__ == "__main__":
329 unittest.main() 331 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_unicodedata.py ('k') | Lib/test/test_uuid.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+