r47106 - Merge deprecate-oscar-8260: Deprecate twisted.words.protocols.oscar
hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Tue, 29 Mar 2016 18:51:10 -0600 (MDT)
| Newsgroups | gmane.comp.python.twisted.commits |
|---|---|
| Message-ID | <[email protected]> |
Author: hawkowl
Date: Tue Mar 29 18:51:05 2016
New Revision: 47106
Added:
trunk/twisted/words/topfiles/8260.removal
Modified:
trunk/twisted/words/protocols/__init__.py
trunk/twisted/words/test/test_oscar.py
Log:
Merge deprecate-oscar-8260: Deprecate twisted.words.protocols.oscar
Author: hawkowl
Reviewer: Lukasa
Fixes: #8260
Modified: trunk/twisted/words/protocols/__init__.py
==============================================================================
--- trunk/twisted/words/protocols/__init__.py (original)
+++ trunk/twisted/words/protocols/__init__.py Tue Mar 29 18:51:05 2016
@@ -4,3 +4,13 @@
"""
Chat protocols.
"""
+
+from twisted.python.versions import Version
+from twisted.python.deprecate import deprecatedModuleAttribute
+
+
+deprecatedModuleAttribute(
+ Version("Twisted", 16, 2, 0),
+ "There is no replacement for this module.",
+ "twisted.words.protocols",
+ "oscar")
Modified: trunk/twisted/words/test/test_oscar.py
==============================================================================
--- trunk/twisted/words/test/test_oscar.py (original)
+++ trunk/twisted/words/test/test_oscar.py Tue Mar 29 18:51:05 2016
@@ -22,3 +22,22 @@
self.assertEqual(
encryptPasswordMD5('foo', 'bar').encode('hex'),
'd73475c370a7b18c6c20386bcf1339f2')
+
+
+
+class OscarDeprecationTests(TestCase):
+ """
+ Tests for the deprecation of L{twisted.words.protocols.oscar}.
+ """
+ def test_deprecated(self):
+ """
+ L{twisted.words.protocols.oscar} is deprecated.
+ """
+ from twisted.words import protocols
+ protocols.oscar
+
+ warnings = self.flushWarnings([self.test_deprecated])
+ self.assertEqual(len(warnings), 1)
+ self.assertEqual(warnings[0]["message"], (
+ "twisted.words.protocols.oscar was deprecated in Twisted 16.2.0: "
+ "There is no replacement for this module."))