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

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

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 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_urllib2net.py ('k') | Lib/test/test_urllibnet.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 3
4 import os 4 import os
5 import io 5 import io
6 import socket 6 import socket
7 import array 7 import array
8 import sys 8 import sys
9 9
10 import urllib.request 10 import urllib.request
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return urlpath 616 return urlpath
617 617
618 class HandlerTests(unittest.TestCase): 618 class HandlerTests(unittest.TestCase):
619 619
620 def test_ftp(self): 620 def test_ftp(self):
621 class MockFTPWrapper: 621 class MockFTPWrapper:
622 def __init__(self, data): self.data = data 622 def __init__(self, data): self.data = data
623 def retrfile(self, filename, filetype): 623 def retrfile(self, filename, filetype):
624 self.filename, self.filetype = filename, filetype 624 self.filename, self.filetype = filename, filetype
625 return io.StringIO(self.data), len(self.data) 625 return io.StringIO(self.data), len(self.data)
626 def close(self): pass
627 626
628 class NullFTPHandler(urllib.request.FTPHandler): 627 class NullFTPHandler(urllib.request.FTPHandler):
629 def __init__(self, data): self.data = data 628 def __init__(self, data): self.data = data
630 def connect_ftp(self, user, passwd, host, port, dirs, 629 def connect_ftp(self, user, passwd, host, port, dirs,
631 timeout=socket._GLOBAL_DEFAULT_TIMEOUT): 630 timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
632 self.user, self.passwd = user, passwd 631 self.user, self.passwd = user, passwd
633 self.host, self.port = host, port 632 self.host, self.port = host, port
634 self.dirs = dirs 633 self.dirs = dirs
635 self.ftpwrapper = MockFTPWrapper(self.data) 634 self.ftpwrapper = MockFTPWrapper(self.data)
636 return self.ftpwrapper 635 return self.ftpwrapper
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 support.run_doctest(urllib.request, verbose) 1438 support.run_doctest(urllib.request, verbose)
1440 tests = (TrivialTests, 1439 tests = (TrivialTests,
1441 OpenerDirectorTests, 1440 OpenerDirectorTests,
1442 HandlerTests, 1441 HandlerTests,
1443 MiscTests, 1442 MiscTests,
1444 RequestTests) 1443 RequestTests)
1445 support.run_unittest(*tests) 1444 support.run_unittest(*tests)
1446 1445
1447 if __name__ == "__main__": 1446 if __name__ == "__main__":
1448 test_main(verbose=True) 1447 test_main(verbose=True)
OLDNEW
« no previous file with comments | « Lib/test/test_urllib2net.py ('k') | Lib/test/test_urllibnet.py » ('j') | no next file with comments »

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