~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-06 22:55:29 UTC
  • mfrom: (1946.2.16 reduce-knit-churn)
  • Revision ID: pqm@pqm.ubuntu.com-20060906225529-7b367edabbb1ffc2
(jam) delay creating knit contents for significantly better new commit and push performance

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
        umask = osutils.get_umask()
244
244
        t.put_bytes_non_atomic('nomode', 'test text\n', mode=None)
245
245
        self.assertTransportMode(t, 'nomode', 0666 & ~umask)
 
246
 
 
247
        # We should also be able to set the mode for a parent directory
 
248
        # when it is created
 
249
        t.put_bytes_non_atomic('dir700/mode664', 'test text\n', mode=0664,
 
250
                               dir_mode=0700, create_parent_dir=True)
 
251
        self.assertTransportMode(t, 'dir700', 0700)
 
252
        t.put_bytes_non_atomic('dir770/mode664', 'test text\n', mode=0664,
 
253
                               dir_mode=0770, create_parent_dir=True)
 
254
        self.assertTransportMode(t, 'dir770', 0770)
 
255
        t.put_bytes_non_atomic('dir777/mode664', 'test text\n', mode=0664,
 
256
                               dir_mode=0777, create_parent_dir=True)
 
257
        self.assertTransportMode(t, 'dir777', 0777)
246
258
        
247
259
    def test_put_file(self):
248
260
        t = self.get_transport()
352
364
        t.put_file_non_atomic('nomode', StringIO('test text\n'), mode=None)
353
365
        self.assertTransportMode(t, 'nomode', 0666 & ~umask)
354
366
        
 
367
        # We should also be able to set the mode for a parent directory
 
368
        # when it is created
 
369
        sio = StringIO()
 
370
        t.put_file_non_atomic('dir700/mode664', sio, mode=0664,
 
371
                              dir_mode=0700, create_parent_dir=True)
 
372
        self.assertTransportMode(t, 'dir700', 0700)
 
373
        t.put_file_non_atomic('dir770/mode664', sio, mode=0664,
 
374
                              dir_mode=0770, create_parent_dir=True)
 
375
        self.assertTransportMode(t, 'dir770', 0770)
 
376
        t.put_file_non_atomic('dir777/mode664', sio, mode=0664,
 
377
                              dir_mode=0777, create_parent_dir=True)
 
378
        self.assertTransportMode(t, 'dir777', 0777)
 
379
 
355
380
    def test_put_multi(self):
356
381
        t = self.get_transport()
357
382