~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_permissions.py

  • Committer: Robert Collins
  • Date: 2006-01-12 01:02:32 UTC
  • mto: (1534.1.6 integration)
  • mto: This revision was merged to the branch mainline in revision 1543.
  • Revision ID: robertc@robertcollins.net-20060112010232-32d7a5b35bbc94df
Review feedback fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
    assert os.path.isdir(base)
66
66
    t = get_transport(".")
67
67
    if include_base:
68
 
        test.assertMode(t, base, dir_mode)
 
68
        test.assertTransportMode(t, base, dir_mode)
69
69
    for root, dirs, files in os.walk(base):
70
70
        for d in dirs:
71
71
            p = os.path.join(root, d)
72
 
            test.assertMode(t, p, dir_mode)
 
72
            test.assertTransportMode(t, p, dir_mode)
73
73
        for f in files:
74
74
            p = os.path.join(root, f)
75
 
            test.assertMode(t, p, file_mode)
 
75
            test.assertTransportMode(t, p, file_mode)
76
76
 
77
77
 
78
78
def assertEqualMode(test, mode, mode_test):
304
304
            t = SFTPTransport(self._sftp_url)
305
305
            # Direct access should be masked by umask
306
306
            t._sftp_open_exclusive('a', mode=0666).write('foo\n')
307
 
            self.assertMode(t, 'a', 0666 &~umask)
 
307
            self.assertTransportMode(t, 'a', 0666 &~umask)
308
308
 
309
309
            # but Transport overrides umask
310
310
            t.put('b', 'txt', mode=0666)
311
 
            self.assertMode(t, 'b', 0666)
 
311
            self.assertTransportMode(t, 'b', 0666)
312
312
 
313
313
            t._sftp.mkdir('c', mode=0777)
314
 
            self.assertMode(t, 'c', 0777 &~umask)
 
314
            self.assertTransportMode(t, 'c', 0777 &~umask)
315
315
 
316
316
            t.mkdir('d', mode=0777)
317
 
            self.assertMode(t, 'd', 0777)
 
317
            self.assertTransportMode(t, 'd', 0777)
318
318
        finally:
319
319
            os.umask(original_umask)
320
320