Ticket #6833: amp-python3-6833-4.add-docstrings.patch

File amp-python3-6833-4.add-docstrings.patch, 1.3 KB (added by Gavin Panella, 4 years ago)

Incremental patch to add missing test docstrings to branches/amp-python3-6833-4.

  • twisted/test/test_amp.py

    diff --git a/twisted/test/test_amp.py b/twisted/test/test_amp.py
    index 7e1d781..6e8dc99 100644
    a b class RemoteAmpErrorTests(unittest.TestCase): 
    32653265    """
    32663266
    32673267    def test_stringMessage(self):
     3268        """
     3269        L{amp.RemoteAmpError} renders the given C{errorCode} (C{bytes}) and
     3270        C{description} into a native string.
     3271        """
    32683272        error = amp.RemoteAmpError(b"BROKEN", "Something has broken")
    32693273        self.assertEqual("Code<BROKEN>: Something has broken", str(error))
    32703274
    32713275
    32723276    def test_stringMessageReplacesNonAsciiText(self):
     3277        """
     3278        When C{errorCode} contains non-ASCII characters, L{amp.RemoteAmpError}
     3279        renders then as backslash-escape sequences.
     3280        """
    32733281        error = amp.RemoteAmpError(b"BROKEN-\xff", "Something has broken")
    32743282        self.assertEqual("Code<BROKEN-\\xff>: Something has broken", str(error))
    32753283
    32763284
    32773285    def test_stringMessageWithLocalFailure(self):
     3286        """
     3287        L{amp.RemoteAmpError} renders local errors with a "(local)" marker and
     3288        a brief traceback.
     3289        """
    32783290        failure = Failure(Exception("Something came loose"))
    32793291        error = amp.RemoteAmpError(
    32803292            b"BROKEN", "Something has broken", local=failure)