~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/test/test_dict.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
 
 
2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
 
3
# See LICENSE for details.
 
4
 
 
5
 
 
6
from twisted.trial import unittest
 
7
from twisted.protocols import dict
 
8
 
 
9
paramString = "\"This is a dqstring \\w\\i\\t\\h boring stuff like: \\\"\" and t\\hes\\\"e are a\\to\\ms"
 
10
goodparams = ["This is a dqstring with boring stuff like: \"", "and", "thes\"e", "are", "atoms"]
 
11
 
 
12
class ParamTest(unittest.TestCase):
 
13
    def testParseParam(self):
 
14
        """Testing command response handling"""
 
15
        params = []
 
16
        rest = paramString
 
17
        while 1:
 
18
            (param, rest) = dict.parseParam(rest)
 
19
            if param == None:
 
20
                break
 
21
            params.append(param)
 
22
        self.failUnlessEqual(params, goodparams)#, "DictClient.parseParam returns unexpected results")