forked from twisted/twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge webhtml-4948-4: Deprecate twisted.web.html.
Author: adiroiban Reviewers: hawkowl Fixes: twisted#4948 git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@45255 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
- Loading branch information
adiroiban
committed
Jul 14, 2015
1 parent
e7feae3
commit 526a7b0
Showing
3 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) Twisted Matrix Laboratories. | ||
# See LICENSE for details. | ||
|
||
from twisted.trial import unittest | ||
from twisted.web import html | ||
|
||
|
||
|
||
class WebHtmlTests(unittest.TestCase): | ||
""" | ||
Unit tests for L{twisted.web.html}. | ||
""" | ||
|
||
def test_deprecation(self): | ||
""" | ||
Calls to L{twisted.web.html} members emit a deprecation warning. | ||
""" | ||
def assertDeprecationWarningOf(method): | ||
""" | ||
Check that a deprecation warning is present. | ||
""" | ||
warningsShown = self.flushWarnings([self.test_deprecation]) | ||
self.assertEqual(len(warningsShown), 1) | ||
self.assertIdentical( | ||
warningsShown[0]['category'], DeprecationWarning) | ||
self.assertEqual( | ||
warningsShown[0]['message'], | ||
'twisted.web.html.%s was deprecated in Twisted 15.3.0; ' | ||
'please use twisted.web.template instead' % ( | ||
method,), | ||
) | ||
|
||
html.PRE('') | ||
assertDeprecationWarningOf('PRE') | ||
|
||
html.UL([]) | ||
assertDeprecationWarningOf('UL') | ||
|
||
html.linkList([]) | ||
assertDeprecationWarningOf('linkList') | ||
|
||
html.output(lambda: None) | ||
assertDeprecationWarningOf('output') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
twisted.web.html is now deprecated in favor of twisted.web.template. |