summaryrefslogtreecommitdiff
path: root/vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py')
-rw-r--r--vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py b/vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py
new file mode 100644
index 0000000000..5d506ab522
--- /dev/null
+++ b/vendor/Twisted-10.0.0/twisted/test/test_timehelpers.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2010 Twisted Matrix Laboratories.
+# See LICENSE for details.
+
+"""
+Tests for the deprecated L{twisted.test.time_helpers} module.
+"""
+
+import sys
+
+from twisted.trial.unittest import TestCase
+
+
+class TimeHelpersTests(TestCase):
+ """
+ A test for the deprecation of the module.
+ """
+ def test_deprecated(self):
+ """
+ Importing L{twisted.test.time_helpers} causes a deprecation warning
+ to be emitted.
+ """
+ # Make sure we're really importing it
+ sys.modules.pop('twisted.test.time_helpers', None)
+ import twisted.test.time_helpers
+ warnings = self.flushWarnings(
+ offendingFunctions=[self.test_deprecated])
+ self.assertEquals(warnings[0]['category'], DeprecationWarning)
+ self.assertEquals(
+ warnings[0]['message'],
+ "twisted.test.time_helpers is deprecated since Twisted 10.0. "
+ "See twisted.internet.task.Clock instead.")