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

Side by Side Diff: Lib/test/test_io.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_imp.py ('k') | Lib/test/test_json/test_tool.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 """Unit tests for the io module.""" 1 """Unit tests for the io module."""
2 2
3 # Tests of io are scattered over the test suite: 3 # Tests of io are scattered over the test suite:
4 # * test_bufio - tests file buffering 4 # * test_bufio - tests file buffering
5 # * test_memoryio - tests BytesIO and StringIO 5 # * test_memoryio - tests BytesIO and StringIO
6 # * test_fileio - tests FileIO 6 # * test_fileio - tests FileIO
7 # * test_file - tests the file interface 7 # * test_file - tests the file interface
8 # * test_io - tests everything else in the io module 8 # * test_io - tests everything else in the io module
9 # * test_univnewlines - tests universal newline support 9 # * test_univnewlines - tests universal newline support
10 # * test_largefile - tests operations on a file greater than 2**32 bytes 10 # * test_largefile - tests operations on a file greater than 2**32 bytes
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 self.write_ops(f) 409 self.write_ops(f)
410 data = f.getvalue() 410 data = f.getvalue()
411 self.assertEqual(data, b"hello world\n") 411 self.assertEqual(data, b"hello world\n")
412 f = self.BytesIO(data) 412 f = self.BytesIO(data)
413 self.read_ops(f, True) 413 self.read_ops(f, True)
414 414
415 def test_large_file_ops(self): 415 def test_large_file_ops(self):
416 # On Windows and Mac OSX this test comsumes large resources; It takes 416 # On Windows and Mac OSX this test comsumes large resources; It takes
417 # a long time to build the >2GB file and takes >2GB of disk space 417 # a long time to build the >2GB file and takes >2GB of disk space
418 # therefore the resource must be enabled to run this test. 418 # therefore the resource must be enabled to run this test.
419 if sys.platform[:3] == 'win' or sys.platform == 'darwin': 419 if sys.platform[:3] == 'win' or sys.platform in ('darwin', 'ios'):
420 support.requires( 420 support.requires(
421 'largefile', 421 'largefile',
422 'test requires %s bytes and a long time to run' % self.LARGE) 422 'test requires %s bytes and a long time to run' % self.LARGE)
423 with self.open(support.TESTFN, "w+b", 0) as f: 423 with self.open(support.TESTFN, "w+b", 0) as f:
424 self.large_file_ops(f) 424 self.large_file_ops(f)
425 with self.open(support.TESTFN, "w+b") as f: 425 with self.open(support.TESTFN, "w+b") as f:
426 self.large_file_ops(f) 426 self.large_file_ops(f)
427 427
428 def test_with_open(self): 428 def test_with_open(self):
429 for bufsize in (0, 1, 100): 429 for bufsize in (0, 1, 100):
(...skipping 3345 matching lines...) Expand 10 before | Expand all | Expand 10 after
3775 setattr(test, name, obj) 3775 setattr(test, name, obj)
3776 elif test.__name__.startswith("Py"): 3776 elif test.__name__.startswith("Py"):
3777 for name, obj in py_io_ns.items(): 3777 for name, obj in py_io_ns.items():
3778 setattr(test, name, obj) 3778 setattr(test, name, obj)
3779 3779
3780 suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests]) 3780 suite = unittest.TestSuite([unittest.makeSuite(test) for test in tests])
3781 return suite 3781 return suite
3782 3782
3783 if __name__ == "__main__": 3783 if __name__ == "__main__":
3784 unittest.main() 3784 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_imp.py ('k') | Lib/test/test_json/test_tool.py » ('j') | no next file with comments »

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