~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/test/test_enterprise.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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, "foo")