Ticket #5004: replace-string-module-web-5004-8.patch

File replace-string-module-web-5004-8.patch, 2.1 KB (added by Jonathan Ballet, 8 years ago)

On top of branches/twisted-web-remove-text-5004 [39084]

  • twisted/web/test/requesthelper.py

    diff --git twisted/web/test/requesthelper.py twisted/web/test/requesthelper.py
    index 2d33db6..e1738fd 100644
    class DummyRequest(object): 
    135135        return self.headers.get(name.lower(), None)
    136136
    137137    def getAllHeaders(self):
     138        """
     139        Retrieve all the values of the request headers as a dictionary.
     140        """
    138141        return self.headers
    139142
    140143    def setHeader(self, name, value):
    class DummyRequest(object): 
    243246
    244247
    245248    def getRequestHostname(self):
     249        """
     250        Get a dummy hostname associated to the HTTP request.
     251
     252        @rtype: C{bytes}
     253        @returns: a dummy hostname
     254        """
    246255        return self._serverName
    247256
    248257
    249258    def getHost(self):
    250         return DummyChannel.TCP()
     259        """
     260        Get a dummy transport's host.
     261
     262        @rtype: C{IPv4Address}
     263        @returns: a dummy transport's host
     264        """
     265        return IPv4Address('TCP', '127.0.0.1', 80)
    251266
    252267
    253268    def getClient(self):
     269        """
     270        Stub to get the client doing the HTTP request.
     271        This merely just ensures that this method exists here. Feel free to
     272        extend it.
     273        """
    254274        pass
  • twisted/web/test/test_util.py

    diff --git twisted/web/test/test_util.py twisted/web/test/test_util.py
    index 893571b..75e80be 100644
    class HtmlIndentTests(TestCase): 
    432432
    433433    def test_simpleInput(self):
    434434        """
    435         L{htmlIndent} transparently process input with no special cases inside.
     435        L{htmlIndent} transparently processes input with no special cases
     436        inside.
    436437        """
    437438        line = "foo bar"
    438439        self.assertEqual(line, htmlIndent(line))
    class HtmlIndentTests(TestCase): 
    465466
    466467    def test_indentFromTabCharacters(self):
    467468        """
    468         L{htmlIndent} replaces tab characters by unbreakable spaces.
     469        L{htmlIndent} replaces tab characters with unbreakable spaces.
    469470        """
    470471        line = "\tfoo"
    471472        self.assertEqual("        foo", htmlIndent(line))