summaryrefslogtreecommitdiff
path: root/python/qpid/tests
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-12-17 04:56:17 +0000
committerRafael H. Schloming <rhs@apache.org>2009-12-17 04:56:17 +0000
commit6f485818cbf237cdcd6fd3bfc7215b61f3656e14 (patch)
treeae4f927d2da1659abe8327dad63f8eb867ceb462 /python/qpid/tests
parentc71bc44601cf19be29be9565f52e512a1e3cb158 (diff)
downloadqpid-python-6f485818cbf237cdcd6fd3bfc7215b61f3656e14.tar.gz
QPID-2286: added list support to address parser
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@891536 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/tests')
-rw-r--r--python/qpid/tests/address.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/python/qpid/tests/address.py b/python/qpid/tests/address.py
index f772425e42..7c101eee5e 100644
--- a/python/qpid/tests/address.py
+++ b/python/qpid/tests/address.py
@@ -145,7 +145,7 @@ class AddressTests(ParserBase, Test):
def testBadOptions3(self):
self.invalid("name/subject; { key:",
- "expecting (NUMBER, STRING, ID, LBRACE), got EOF "
+ "expecting (NUMBER, STRING, ID, LBRACE, LBRACK), got EOF "
"line:1,20:name/subject; { key:")
def testBadOptions4(self):
@@ -167,3 +167,33 @@ class AddressTests(ParserBase, Test):
self.invalid("name/subject; { key: value } asdf",
"expecting EOF, got ID('asdf') "
"line:1,29:name/subject; { key: value } asdf")
+
+ def testList1(self):
+ self.valid("name/subject; { key: [] }", "name", "subject", {"key": []})
+
+ def testList2(self):
+ self.valid("name/subject; { key: ['one'] }", "name", "subject", {"key": ['one']})
+
+ def testList3(self):
+ self.valid("name/subject; { key: [1, 2, 3] }", "name", "subject",
+ {"key": [1, 2, 3]})
+
+ def testList4(self):
+ self.valid("name/subject; { key: [1, [2, 3], 4] }", "name", "subject",
+ {"key": [1, [2, 3], 4]})
+
+ def testBadList1(self):
+ self.invalid("name/subject; { key: [ }", "expecting (NUMBER, STRING, ID, LBRACE, LBRACK), "
+ "got RBRACE('}') line:1,23:name/subject; { key: [ }")
+
+ def testBadList2(self):
+ self.invalid("name/subject; { key: [ 1 }", "expecting (COMMA, RBRACK), "
+ "got RBRACE('}') line:1,25:name/subject; { key: [ 1 }")
+
+ def testBadList3(self):
+ self.invalid("name/subject; { key: [ 1 2 }", "expecting (COMMA, RBRACK), "
+ "got NUMBER('2') line:1,25:name/subject; { key: [ 1 2 }")
+
+ def testBadList4(self):
+ self.invalid("name/subject; { key: [ 1 2 ] }", "expecting (COMMA, RBRACK), "
+ "got NUMBER('2') line:1,25:name/subject; { key: [ 1 2 ] }")