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

Side by Side Diff: Lib/distutils/tests/test_util.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 9 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/distutils/tests/test_sysconfig.py ('k') | Lib/importlib/_bootstrap_external.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 """Tests for distutils.util.""" 1 """Tests for distutils.util."""
2 import os 2 import os
3 import sys 3 import sys
4 import unittest 4 import unittest
5 from copy import copy 5 from copy import copy
6 from test.support import run_unittest 6 from test.support import run_unittest
7 7
8 from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError 8 from distutils.errors import DistutilsPlatformError, DistutilsByteCompileError
9 from distutils.util import (get_platform, convert_path, change_root, 9 from distutils.util import (get_platform, convert_path, change_root,
10 check_environ, split_quoted, strtobool, 10 check_environ, split_quoted, strtobool,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 self.assertEqual(change_root('c:\\root', 'its\\here'), 232 self.assertEqual(change_root('c:\\root', 'its\\here'),
233 'c:\\root\\its\\here') 233 'c:\\root\\its\\here')
234 234
235 # BugsBunny os (it's a great os) 235 # BugsBunny os (it's a great os)
236 os.name = 'BugsBunny' 236 os.name = 'BugsBunny'
237 self.assertRaises(DistutilsPlatformError, 237 self.assertRaises(DistutilsPlatformError,
238 change_root, 'c:\\root', 'its\\here') 238 change_root, 'c:\\root', 'its\\here')
239 239
240 # XXX platforms to be covered: mac 240 # XXX platforms to be covered: mac
241 241
242 @unittest.skipUnless(os.name == 'nt' or (os.name == 'posix' and hasattr(os, 'fork')), "distutils cannot spawn child processes")
242 def test_check_environ(self): 243 def test_check_environ(self):
243 util._environ_checked = 0 244 util._environ_checked = 0
244 if 'HOME' in os.environ: 245 if 'HOME' in os.environ:
245 del os.environ['HOME'] 246 del os.environ['HOME']
246 247
247 # posix without HOME 248 # posix without HOME
248 if os.name == 'posix': # this test won't run on windows 249 if os.name == 'posix': # this test won't run on windows
249 check_environ() 250 check_environ()
250 import pwd 251 import pwd
251 self.assertEqual(os.environ['HOME'], pwd.getpwuid(os.getuid())[5]) 252 self.assertEqual(os.environ['HOME'], pwd.getpwuid(os.getuid())[5])
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 exc = IOError("Unable to find batch file") 292 exc = IOError("Unable to find batch file")
292 msg = grok_environment_error(exc) 293 msg = grok_environment_error(exc)
293 self.assertEqual(msg, "error: Unable to find batch file") 294 self.assertEqual(msg, "error: Unable to find batch file")
294 295
295 296
296 def test_suite(): 297 def test_suite():
297 return unittest.makeSuite(UtilTestCase) 298 return unittest.makeSuite(UtilTestCase)
298 299
299 if __name__ == "__main__": 300 if __name__ == "__main__":
300 run_unittest(test_suite()) 301 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « Lib/distutils/tests/test_sysconfig.py ('k') | Lib/importlib/_bootstrap_external.py » ('j') | no next file with comments »

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