/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_atomicfile.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import stat
21
21
import sys
22
22
 
23
 
from bzrlib import (
 
23
from .. import (
24
24
    atomicfile,
25
25
    errors,
26
26
    osutils,
27
27
    symbol_versioning,
28
28
    )
29
 
from bzrlib.tests import TestCaseInTempDir, TestSkipped
 
29
from . import TestCaseInTempDir, TestSkipped
30
30
 
31
31
 
32
32
class TestAtomicFile(TestCaseInTempDir):
94
94
        self.assertEqualMode(mode, stat.S_IMODE(st.st_mode))
95
95
 
96
96
    def test_mode_0666(self):
97
 
        self._test_mode(0666)
 
97
        self._test_mode(0o666)
98
98
 
99
99
    def test_mode_0664(self):
100
 
        self._test_mode(0664)
101
 
 
102
 
    def test_mode_0660(self):
103
 
        self._test_mode(0660)
104
 
 
105
 
    def test_mode_0660(self):
106
 
        self._test_mode(0660)
 
100
        self._test_mode(0o664)
 
101
 
 
102
    def test_mode_0660(self):
 
103
        self._test_mode(0o660)
 
104
 
 
105
    def test_mode_0660(self):
 
106
        self._test_mode(0o660)
107
107
 
108
108
    def test_mode_0640(self):
109
 
        self._test_mode(0640)
 
109
        self._test_mode(0o640)
110
110
 
111
111
    def test_mode_0600(self):
112
 
        self._test_mode(0600)
 
112
        self._test_mode(0o600)
113
113
 
114
114
    def test_mode_0400(self):
115
 
        self._test_mode(0400)
 
115
        self._test_mode(0o400)
116
116
        # Make it read-write again so cleanup doesn't complain
117
 
        os.chmod('test', 0600)
 
117
        os.chmod('test', 0o600)
118
118
 
119
119
    def test_no_mode(self):
120
120
        # The default file permissions should be based on umask
123
123
        f.write('foo\n')
124
124
        f.commit()
125
125
        st = os.lstat('test')
126
 
        self.assertEqualMode(0666 & ~umask, stat.S_IMODE(st.st_mode))
 
126
        self.assertEqualMode(0o666 & ~umask, stat.S_IMODE(st.st_mode))