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

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

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 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_curses.py ('k') | Lib/test/test_sundry.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 # As a test suite for the os module, this is woefully inadequate, but this 1 # As a test suite for the os module, this is woefully inadequate, but this
2 # does add tests for a few functions which have been determined to be more 2 # does add tests for a few functions which have been determined to be more
3 # portable than they had been thought to be. 3 # portable than they had been thought to be.
4 4
5 import os 5 import os
6 import errno 6 import errno
7 import unittest 7 import unittest
8 import warnings 8 import warnings
9 import sys 9 import sys
10 import signal 10 import signal
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return buf.value 454 return buf.value
455 455
456 if get_file_system(support.TESTFN) == "NTFS": 456 if get_file_system(support.TESTFN) == "NTFS":
457 def test_1565150(self): 457 def test_1565150(self):
458 t1 = 1159195039.25 458 t1 = 1159195039.25
459 os.utime(self.fname, (t1, t1)) 459 os.utime(self.fname, (t1, t1))
460 self.assertEqual(os.stat(self.fname).st_mtime, t1) 460 self.assertEqual(os.stat(self.fname).st_mtime, t1)
461 461
462 def test_large_time(self): 462 def test_large_time(self):
463 t1 = 5000000000 # some day in 2128 463 t1 = 5000000000 # some day in 2128
464 os.utime(self.fname, (t1, t1)) 464 try:
465 #Note fail if time_t is 32 bit
466 os.utime(self.fname, (t1, t1))
467 except OverflowError:
468 self.skipTest("requires at least 64-bit time_t")
465 self.assertEqual(os.stat(self.fname).st_mtime, t1) 469 self.assertEqual(os.stat(self.fname).st_mtime, t1)
466 470
467 def test_1686475(self): 471 def test_1686475(self):
468 # Verify that an open file can be stat'ed 472 # Verify that an open file can be stat'ed
469 try: 473 try:
470 os.stat(r"c:\pagefile.sys") 474 os.stat(r"c:\pagefile.sys")
471 except WindowsError as e: 475 except WindowsError as e:
472 if e.errno == 2: # file does not exist; cannot run test 476 if e.errno == 2: # file does not exist; cannot run test
473 return 477 return
474 self.fail("Could not stat pagefile.sys") 478 self.fail("Could not stat pagefile.sys")
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
2121 TestSendfile, 2125 TestSendfile,
2122 ProgramPriorityTests, 2126 ProgramPriorityTests,
2123 ExtendedAttributeTests, 2127 ExtendedAttributeTests,
2124 Win32DeprecatedBytesAPI, 2128 Win32DeprecatedBytesAPI,
2125 TermsizeTests, 2129 TermsizeTests,
2126 RemoveDirsTests, 2130 RemoveDirsTests,
2127 ) 2131 )
2128 2132
2129 if __name__ == "__main__": 2133 if __name__ == "__main__":
2130 test_main() 2134 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_curses.py ('k') | Lib/test/test_sundry.py » ('j') | no next file with comments »

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