~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: 2008-06-09 07:45:19 UTC
  • mfrom: (3484.2.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080609074519-afx3xh7bd8wqzjy0
(vila) Trivial drive-by cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
951
951
        except TransportNotPossible:
952
952
            # ok, this transport does not support delete_tree
953
953
            return
954
 
        
 
954
 
955
955
        # did it delete that trivial case?
956
956
        self.assertRaises(NoSuchFile, t.stat, 'adir')
957
957
 
958
958
        self.build_tree(['adir/',
959
 
                         'adir/file', 
960
 
                         'adir/subdir/', 
961
 
                         'adir/subdir/file', 
 
959
                         'adir/file',
 
960
                         'adir/subdir/',
 
961
                         'adir/subdir/file',
962
962
                         'adir/subdir2/',
963
963
                         'adir/subdir2/file',
964
964
                         ], transport=t)
1045
1045
            return
1046
1046
 
1047
1047
        paths = ['a', 'b/', 'b/c', 'b/d/', 'b/d/e']
1048
 
        sizes = [14, 0, 16, 0, 18] 
 
1048
        sizes = [14, 0, 16, 0, 18]
1049
1049
        self.build_tree(paths, transport=t, line_endings='binary')
1050
1050
 
1051
1051
        for path, size in zip(paths, sizes):
1073
1073
    def test_list_dir(self):
1074
1074
        # TODO: Test list_dir, just try once, and if it throws, stop testing
1075
1075
        t = self.get_transport()
1076
 
        
 
1076
 
1077
1077
        if not t.listable():
1078
1078
            self.assertRaises(TransportNotPossible, t.list_dir, '.')
1079
1079
            return
1109
1109
        else:
1110
1110
            os.unlink('c/d')
1111
1111
            os.unlink('b')
1112
 
            
 
1112
 
1113
1113
        self.assertEqual(['a', 'a%2525b', 'c', 'c2'], sorted_list('.', t))
1114
1114
        self.assertEqual(['e'], sorted_list('c', t))
1115
1115
 
1126
1126
            self.build_tree(['a/', 'a/%'], transport=t)
1127
1127
        else:
1128
1128
            self.build_tree(['a/', 'a/%'])
1129
 
        
 
1129
 
1130
1130
        names = list(t.list_dir('a'))
1131
1131
        self.assertEqual(['%25'], names)
1132
1132
        self.assertIsInstance(names[0], str)