~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge from list_dir return type

Show diffs side-by-side

added added

removed removed

Lines of Context:
748
748
        else:
749
749
            self.build_tree(['wd/a', 'wd/b', 'wd/c/', 'wd/c/d', 'wd/c/e', 'wd/c2/'])
750
750
 
751
 
        self.assertEqual([u'a', u'b', u'c', u'c2'], sorted_list('.'))
752
 
        self.assertEqual([u'd', u'e'], sorted_list('c'))
 
751
        self.assertEqual(['a', 'b', 'c', 'c2'], sorted_list('.'))
 
752
        self.assertEqual(['d', 'e'], sorted_list('c'))
753
753
 
754
754
        if not t.is_readonly():
755
755
            t.delete('c/d')
758
758
            os.unlink('wd/c/d')
759
759
            os.unlink('wd/b')
760
760
            
761
 
        self.assertEqual([u'a', u'c', u'c2'], sorted_list('.'))
762
 
        self.assertEqual([u'e'], sorted_list('c'))
 
761
        self.assertEqual(['a', 'c', 'c2'], sorted_list('.'))
 
762
        self.assertEqual(['e'], sorted_list('c'))
763
763
 
764
764
        self.assertListRaises(PathError, t.list_dir, 'q')
765
765
        self.assertListRaises(PathError, t.list_dir, 'c/f')
766
766
        self.assertListRaises(PathError, t.list_dir, 'a')
767
767
 
 
768
    def test_list_dir_result_is_url_escaped(self):
 
769
        t = self.get_transport()
 
770
        if not t.listable():
 
771
            raise TestSkipped("transport not listable")
 
772
 
 
773
        if not t.is_readonly():
 
774
            self.build_tree(['a/', 'a/%'], transport=t)
 
775
        else:
 
776
            self.build_tree(['a/', 'a/%'])
 
777
        
 
778
        self.assertEqual(['%25'], list(t.list_dir('a')))
 
779
 
768
780
    def test_clone(self):
769
781
        # TODO: Test that clone moves up and down the filesystem
770
782
        t1 = self.get_transport()