~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Andrew Bennetts
  • Date: 2007-03-13 05:27:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2357.
  • Revision ID: andrew.bennetts@canonical.com-20070313052712-fjpwxnglz6nlmehu
Fix bug in MemoryTransport.rmdir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
759
759
        t.mkdir('adir/bdir')
760
760
        self.assertRaises(PathError, t.rmdir, 'adir')
761
761
 
 
762
    def test_rmdir_empty_but_similar_prefix(self):
 
763
        """rmdir does not get confused by sibling paths.
 
764
        
 
765
        A naive implementation of MemoryTransport would refuse to rmdir
 
766
        ".bzr/branch" if there is a ".bzr/branch-format" directory, because it
 
767
        uses "path.startswith(dir)" on all file paths to determine if directory
 
768
        is empty.
 
769
        """
 
770
        t = self.get_transport()
 
771
        if t.is_readonly():
 
772
            return
 
773
        t.mkdir('foo')
 
774
        t.put_bytes('foo-bar', '')
 
775
        t.mkdir('foo-baz')
 
776
        t.rmdir('foo')
 
777
        self.assertRaises((NoSuchFile, PathError), t.rmdir, 'foo')
 
778
        self.failUnless(t.has('foo-bar'))
 
779
 
762
780
    def test_rename_dir_succeeds(self):
763
781
        t = self.get_transport()
764
782
        if t.is_readonly():