OLD | NEW |
| (Empty) |
1 # Copyright (c) 2001-2008 Twisted Matrix Laboratories. | |
2 # See LICENSE for details. | |
3 | |
4 """ | |
5 General tests for twisted.enterprise. | |
6 """ | |
7 | |
8 from twisted.trial import unittest | |
9 | |
10 from twisted.enterprise import util | |
11 | |
12 class QuotingTestCase(unittest.TestCase): | |
13 | |
14 def testQuoting(self): | |
15 for value, typ, expected in [ | |
16 (12, "integer", "12"), | |
17 ("foo'd", "text", "'foo''d'"), | |
18 ("\x00abc\\s\xFF", "bytea", "'\\\\000abc\\\\\\\\s\\377'"), | |
19 (12, "text", "'12'"), | |
20 (u"123'456", "text", u"'123''456'") | |
21 ]: | |
22 self.assertEquals( | |
23 self.callDeprecated(util._deprecatedVersion, util.quote, value, | |
24 typ), | |
25 expected) | |
26 | |
27 | |
28 def test_safeDeprecation(self): | |
29 """ | |
30 L{safe} is deprecated. | |
31 """ | |
32 self.callDeprecated(util._deprecatedVersion, util.safe, "foo") | |
33 | |
34 | |
35 def test_getKeyColumnDeprecation(self): | |
36 """ | |
37 L{getKeyColumn} is deprecated. | |
38 """ | |
39 class Row(object): | |
40 rowKeyColumns = () | |
41 self.callDeprecated(util._deprecatedVersion, util.getKeyColumn, Row, "fo
o") | |
OLD | NEW |