~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-10 06:14:23 UTC
  • mfrom: (1755.3.12 reduce-chmod)
  • Revision ID: pqm@pqm.ubuntu.com-20060810061423-3ae5999a70b60211
(robertc,jam) tweak Transport.append and AtomicFile so put and append are cheaper

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
            finally:
132
132
                os.remove('socket')
133
133
 
 
134
    def test_get_umask(self):
 
135
        if sys.platform == 'win32':
 
136
            # umask always returns '0', no way to set it
 
137
            self.assertEqual(0, osutils.get_umask())
 
138
            return
 
139
 
 
140
        orig_umask = osutils.get_umask()
 
141
        try:
 
142
            os.umask(0222)
 
143
            self.assertEqual(0222, osutils.get_umask())
 
144
            os.umask(0022)
 
145
            self.assertEqual(0022, osutils.get_umask())
 
146
            os.umask(0002)
 
147
            self.assertEqual(0002, osutils.get_umask())
 
148
            os.umask(0027)
 
149
            self.assertEqual(0027, osutils.get_umask())
 
150
        finally:
 
151
            os.umask(orig_umask)
 
152
 
134
153
 
135
154
class TestSafeUnicode(TestCase):
136
155