/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-27 06:10:18 UTC
  • mfrom: (3309 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20080327061018-dxztpxyv6yoeg3am
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
                           FileExists,
39
39
                           InvalidURL,
40
40
                           LockError,
41
 
                           NoSmartServer,
42
41
                           NoSuchFile,
43
42
                           NotLocalUrl,
44
43
                           PathError,
96
95
                    result.append(scenario)
97
96
            except errors.DependencyNotPresent, e:
98
97
                # Continue even if a dependency prevents us 
99
 
                # from running this test
 
98
                # from adding this test
100
99
                pass
101
100
        return result
102
101
 
1071
1070
            self.assertRaises(TransportNotPossible, t.list_dir, '.')
1072
1071
            return
1073
1072
 
1074
 
        def sorted_list(d):
1075
 
            l = list(t.list_dir(d))
 
1073
        def sorted_list(d, transport):
 
1074
            l = list(transport.list_dir(d))
1076
1075
            l.sort()
1077
1076
            return l
1078
1077
 
1079
 
        self.assertEqual([], sorted_list('.'))
 
1078
        self.assertEqual([], sorted_list('.', t))
1080
1079
        # c2 is precisely one letter longer than c here to test that
1081
1080
        # suffixing is not confused.
1082
1081
        # a%25b checks that quoting is done consistently across transports
1088
1087
            self.build_tree(tree_names)
1089
1088
 
1090
1089
        self.assertEqual(
1091
 
            ['a', 'a%2525b', 'b', 'c', 'c2'], sorted_list('.'))
1092
 
        self.assertEqual(['d', 'e'], sorted_list('c'))
 
1090
            ['a', 'a%2525b', 'b', 'c', 'c2'], sorted_list('', t))
 
1091
        self.assertEqual(
 
1092
            ['a', 'a%2525b', 'b', 'c', 'c2'], sorted_list('.', t))
 
1093
        self.assertEqual(['d', 'e'], sorted_list('c', t))
 
1094
 
 
1095
        # Cloning the transport produces an equivalent listing
 
1096
        self.assertEqual(['d', 'e'], sorted_list('', t.clone('c')))
1093
1097
 
1094
1098
        if not t.is_readonly():
1095
1099
            t.delete('c/d')
1098
1102
            os.unlink('c/d')
1099
1103
            os.unlink('b')
1100
1104
            
1101
 
        self.assertEqual(['a', 'a%2525b', 'c', 'c2'], sorted_list('.'))
1102
 
        self.assertEqual(['e'], sorted_list('c'))
 
1105
        self.assertEqual(['a', 'a%2525b', 'c', 'c2'], sorted_list('.', t))
 
1106
        self.assertEqual(['e'], sorted_list('c', t))
1103
1107
 
1104
1108
        self.assertListRaises(PathError, t.list_dir, 'q')
1105
1109
        self.assertListRaises(PathError, t.list_dir, 'c/f')