/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: mbp at sourcefrog
  • Date: 2006-11-21 01:08:52 UTC
  • mfrom: (2004.1.42 bzr.urllib.keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: mbp@sourcefrog.net-20061121010852-838b560632acc36c
merge urllib keepalive etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        """Check that transport.get(relpath).read() == content."""
58
58
        self.assertEqualDiff(content, transport.get(relpath).read())
59
59
 
60
 
    def assertListRaises(self, excClass, func, *args, **kwargs):
61
 
        """Fail unless excClass is raised when the iterator from func is used.
62
 
        
63
 
        Many transport functions can return generators this makes sure
64
 
        to wrap them in a list() call to make sure the whole generator
65
 
        is run, and that the proper exception is raised.
66
 
        """
67
 
        try:
68
 
            list(func(*args, **kwargs))
69
 
        except excClass:
70
 
            return
71
 
        else:
72
 
            if getattr(excClass,'__name__', None) is not None:
73
 
                excName = excClass.__name__
74
 
            else:
75
 
                excName = str(excClass)
76
 
            raise self.failureException, "%s not raised" % excName
77
 
 
78
60
    def test_has(self):
79
61
        t = self.get_transport()
80
62
 
1303
1285
        else:
1304
1286
            transport.put_bytes('a', '0123456789')
1305
1287
 
 
1288
        d = list(transport.readv('a', ((0, 1),)))
 
1289
        self.assertEqual(d[0], (0, '0'))
 
1290
 
1306
1291
        d = list(transport.readv('a', ((0, 1), (1, 1), (3, 2), (9, 1))))
1307
1292
        self.assertEqual(d[0], (0, '0'))
1308
1293
        self.assertEqual(d[1], (1, '1'))