r47105 - deprecate
hawkowl-TA+aISz0psMTMxyoc4vAAJOcrHinNvQL0E9HWUfgJXw@public.gmane.org Tue, 29 Mar 2016 10:46:40 -0600 (MDT)
| Newsgroups | gmane.comp.python.twisted.commits |
|---|---|
| Message-ID | <[email protected]> |
Author: hawkowl
Date: Tue Mar 29 10:46:35 2016
New Revision: 47105
Added:
branches/deprecate-oscar-8260/twisted/words/topfiles/8260.removal
Modified:
branches/deprecate-oscar-8260/twisted/words/protocols/__init__.py
branches/deprecate-oscar-8260/twisted/words/test/test_oscar.py
Log:
deprecate
Modified: branches/deprecate-oscar-8260/twisted/words/protocols/__init__.py
==============================================================================
--- branches/deprecate-oscar-8260/twisted/words/protocols/__init__.py (original)
+++ branches/deprecate-oscar-8260/twisted/words/protocols/__init__.py Tue Mar 29 10:46:35 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: branches/deprecate-oscar-8260/twisted/words/test/test_oscar.py
==============================================================================
--- branches/deprecate-oscar-8260/twisted/words/test/test_oscar.py (original)
+++ branches/deprecate-oscar-8260/twisted/words/test/test_oscar.py Tue Mar 29 10:46:35 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."))