/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: Aaron Bentley
  • Date: 2007-07-17 13:27:14 UTC
  • mfrom: (2624 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070717132714-tmzx9khmg9501k51
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
        self.assertListRaises(NoSuchFile, t.get_multi, ['a', 'b', 'c'])
182
182
        self.assertListRaises(NoSuchFile, t.get_multi, iter(['a', 'b', 'c']))
183
183
 
 
184
    def test_get_directory_read_gives_ReadError(self):
 
185
        """consistent errors for read() on a file returned by get()."""
 
186
        t = self.get_transport()
 
187
        if t.is_readonly():
 
188
            self.build_tree(['a directory/'])
 
189
        else:
 
190
            t.mkdir('a%20directory')
 
191
        # getting the file must either work or fail with a PathError
 
192
        try:
 
193
            a_file = t.get('a%20directory')
 
194
        except (errors.PathError, errors.RedirectRequested):
 
195
            # early failure return immediately.
 
196
            return
 
197
        # having got a file, read() must either work (i.e. http reading a dir listing) or
 
198
        # fail with ReadError
 
199
        try:
 
200
            a_file.read()
 
201
        except errors.ReadError:
 
202
            pass
 
203
 
184
204
    def test_get_bytes(self):
185
205
        t = self.get_transport()
186
206