Ticket #6120: 3453.patch

File 3453.patch, 902 bytes (added by moijes12, 9 years ago)
  • twisted/web/test/test_http.py

     
    16511651        req = http.Request(channel, False)
    16521652        req.connectionLost(Failure(ConnectionLost("The end.")))
    16531653        self.assertRaises(RuntimeError, req.finish)
     1654       
     1655       
     1656    def test_repr(self):
     1657        """
     1658        Test that L{Request.__repr__} returns <METHOD URI PROTOCOL>.
     1659        """
     1660        request = http.Request(DummyChannel(), False)
     1661        request.clientproto = b"HTTP/1.0"
     1662        request.method = b"GET"
     1663        request.uri = b"/foo/bar"
     1664        self.assertEqual(repr(request),
     1665                         "<" + request.method + " " +
     1666                         request.uri +  " " +
     1667                         request.clientproto + ">")
    16541668
    16551669
    16561670