/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_smart_request.py

  • Committer: Jelmer Vernooij
  • Date: 2009-03-12 14:02:53 UTC
  • mfrom: (4135 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4137.
  • Revision ID: jelmer@samba.org-20090312140253-bmldbzlmsitfdrzf
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        handler.end_received()
44
44
        # Request done, no exception was raised.
45
45
 
46
 
    def test_unexpected_body(self):
47
 
        """If a request implementation receives an unexpected body, it
48
 
        raises an error.
49
 
        """
50
 
        # Create a SmartServerRequestHandler with a SmartServerRequest subclass
51
 
        # that does not implement do_body.
52
 
        handler = request.SmartServerRequestHandler(
53
 
            None, {'foo': NoBodyRequest}, '/')
54
 
        # Emulate a request with a body
55
 
        handler.args_received(('foo',))
56
 
        handler.accept_body('some body bytes')
57
 
        # Note that the exception currently occurs at the end of the request.
58
 
        # In principle it would also be ok for it to happen earlier, during
59
 
        # accept_body.
60
 
        exc = self.assertRaises(errors.SmartProtocolError, handler.end_received)
61
 
        self.assertEquals('Request does not expect a body', exc.details)
62