Ticket #6395: 6395.patch

File 6395.patch, 2.1 KB (added by moijes12, 5 years ago)

Completing dhanush's work. Tests have been run against the patch and they pass. Also, the warning is now raised.

  • twisted/words/protocols/__init__.py

     
    55"""
    66Chat protocols.
    77"""
     8
     9from twisted.python import deprecate, versions
     10
     11deprecate.deprecatedModuleAttribute(
     12    versions.Version("Twisted", 13, 3, 0), "MSN has shutdown.", __name__,
     13    "msn")
     14 No newline at end of file
  • twisted/words/test/test_msn.py

     
    513513        d.addCallback(check)
    514514        return d
    515515
     516
     517
     518class DeprecationTests(unittest.TestCase):
     519    """
     520    Test deprecation of L{twisted.words.protocols.msn}
     521    """
     522   
     523    def test_deprecation(self):
     524        """
     525        Accessing L{twisted.words.protocols.msn} emits a deprecation warning
     526        """
     527        from twisted.words.protocols import msn
     528        warningsShown = self.flushWarnings([self.test_deprecation])
     529        self.assertEqual(len(warningsShown), 1)
     530        self.assertIdentical(warningsShown[0]['category'], DeprecationWarning)
     531        self.assertEqual(
     532            warningsShown[0]['message'],
     533            'twisted.words.protocols.msn was deprecated in Twisted 13.3.0: ' +
     534            'MSN has shutdown.')
     535
    516536if msn is None:
    517537    for testClass in [DispatchTests, PassportTests, NotificationTests,
    518                       MessageHandlingTests, FileTransferTestCase]:
     538                      MessageHandlingTests, FileTransferTestCase,
     539                      DeprecationTests]:
    519540        testClass.skip = (
    520541            "MSN requires an HTTP client but none is available, "
    521542            "skipping tests.")
  • twisted/words/topfiles/6395.misc

     
     1twisted.words.protocols.msn is now deprecated
     2 No newline at end of file