~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/test/test_os.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
644
644
                self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
645
645
                self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
646
646
 
 
647
            def test_setreuid_neg1(self):
 
648
                # Needs to accept -1.  We run this in a subprocess to avoid
 
649
                # altering the test runner's process state (issue8045).
 
650
                import subprocess
 
651
                subprocess.check_call([
 
652
                        sys.executable, '-c',
 
653
                        'import os,sys;os.setreuid(-1,-1);sys.exit(0)'])
 
654
 
647
655
        if hasattr(os, 'setregid'):
648
656
            def test_setregid(self):
649
657
                if os.getuid() != 0:
650
658
                    self.assertRaises(os.error, os.setregid, 0, 0)
651
659
                self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
652
660
                self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
 
661
 
 
662
            def test_setregid_neg1(self):
 
663
                # Needs to accept -1.  We run this in a subprocess to avoid
 
664
                # altering the test runner's process state (issue8045).
 
665
                import subprocess
 
666
                subprocess.check_call([
 
667
                        sys.executable, '-c',
 
668
                        'import os,sys;os.setregid(-1,-1);sys.exit(0)'])
653
669
else:
654
670
    class PosixUidGidTests(unittest.TestCase):
655
671
        pass