1
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
General tests for twisted.enterprise.
8
from twisted.trial import unittest
10
from twisted.enterprise import util
12
class QuotingTestCase(unittest.TestCase):
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'"),
20
(u"123'456", "text", u"'123''456'")
23
self.callDeprecated(util._deprecatedVersion, util.quote, value,
28
def test_safeDeprecation(self):
30
L{safe} is deprecated.
32
self.callDeprecated(util._deprecatedVersion, util.safe, "foo")
35
def test_getKeyColumnDeprecation(self):
37
L{getKeyColumn} is deprecated.
41
self.callDeprecated(util._deprecatedVersion, util.getKeyColumn, Row, "foo")