~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Robey Pointer
  • Date: 2006-09-03 00:28:18 UTC
  • mfrom: (1981 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060903002818-71ca5c7bfea93a26
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
        self.check_transport_contents('another contents\nfor d\n', t, 'd')
145
145
 
146
146
        self.assertRaises(NoSuchFile,
147
 
                          t.put, 'path/doesnt/exist/c', 'contents')
 
147
                          t.put, 'path/doesnt/exist/c', StringIO('contents'))
148
148
 
149
149
    def test_put_permissions(self):
150
150
        t = self.get_transport()
545
545
        t.mkdir('adir')
546
546
        t.mkdir('adir/bdir')
547
547
        t.rmdir('adir/bdir')
548
 
        self.assertRaises(NoSuchFile, t.stat, 'adir/bdir')
 
548
        # ftp may not be able to raise NoSuchFile for lack of
 
549
        # details when failing
 
550
        self.assertRaises((NoSuchFile, PathError), t.rmdir, 'adir/bdir')
549
551
        t.rmdir('adir')
550
 
        self.assertRaises(NoSuchFile, t.stat, 'adir')
 
552
        self.assertRaises((NoSuchFile, PathError), t.rmdir, 'adir')
551
553
 
552
554
    def test_rmdir_not_empty(self):
553
555
        """Deleting a non-empty directory raises an exception
775
777
        self.assertListRaises(PathError, t.list_dir, 'c/f')
776
778
        self.assertListRaises(PathError, t.list_dir, 'a')
777
779
 
 
780
    def test_list_dir_result_is_url_escaped(self):
 
781
        t = self.get_transport()
 
782
        if not t.listable():
 
783
            raise TestSkipped("transport not listable")
 
784
 
 
785
        if not t.is_readonly():
 
786
            self.build_tree(['a/', 'a/%'], transport=t)
 
787
        else:
 
788
            self.build_tree(['a/', 'a/%'])
 
789
        
 
790
        names = list(t.list_dir('a'))
 
791
        self.assertEqual(['%25'], names)
 
792
        self.assertIsInstance(names[0], str)
 
793
 
778
794
    def test_clone(self):
779
795
        # TODO: Test that clone moves up and down the filesystem
780
796
        t1 = self.get_transport()