| OLD | NEW |
| (Empty) |
| 1 import os, string, shutil | |
| 2 | |
| 3 from twisted.trial import unittest, util | |
| 4 from twisted.python import reflect | |
| 5 | |
| 6 | |
| 7 movedModules = [('twisted.protocols.smtp', 'twisted.mail.smtp'), | |
| 8 ('twisted.protocols.imap4', 'twisted.mail.imap4'), | |
| 9 ('twisted.protocols.pop3', 'twisted.mail.pop3'), | |
| 10 ('twisted.protocols.dns', 'twisted.names.dns'), | |
| 11 ('twisted.protocols.ethernet', 'twisted.pair.ethernet'), | |
| 12 ('twisted.protocols.raw', 'twisted.pair.raw'), | |
| 13 ('twisted.protocols.rawudp', 'twisted.pair.rawudp'), | |
| 14 ('twisted.protocols.ip', 'twisted.pair.ip'), | |
| 15 ('twisted.protocols.irc', 'twisted.words.protocols.irc'), | |
| 16 ('twisted.protocols.msn', 'twisted.words.protocols.msn'), | |
| 17 ('twisted.protocols.toc', 'twisted.words.protocols.toc'), | |
| 18 ('twisted.protocols.oscar', 'twisted.words.protocols.oscar'), | |
| 19 ] | |
| 20 | |
| 21 | |
| 22 class TestCompatibility(unittest.TestCase): | |
| 23 def testCompatibility(self): | |
| 24 for oldName, newName in movedModules: | |
| 25 try: | |
| 26 old = reflect.namedModule(oldName) | |
| 27 new = reflect.namedModule(newName) | |
| 28 except ImportError, e: | |
| 29 continue | |
| 30 for someName in vars(new): | |
| 31 if someName == '__doc__': | |
| 32 continue | |
| 33 self.assertIdentical(getattr(old, someName), | |
| 34 getattr(new, someName)) | |
| 35 testCompatibility.suppress = [util.suppress(category=DeprecationWarning)] | |
| OLD | NEW |