Permalink
Browse files

Added parameter order test

  • Loading branch information...
1 parent 7cf8e05 commit 299175404a38740632753c2301c73fb70cdbcf15 @koelie koelie committed Mar 16, 2013
Showing with 14 additions and 2 deletions.
  1. +14 −2 tests/json.py
View
@@ -4,8 +4,9 @@
import unittest
class TestJSONHandler(TestHandler, JSONRPCHandler):
- pass
-
+ def testOrder(self, a=1, b=2, c=3):
+ return {'a': a, 'b': b, 'c': c}
+
class JSONRPCTests(RPCTests, unittest.TestCase):
port = 8003
handler = TestJSONHandler
@@ -18,3 +19,14 @@ def test_private(self):
client = self.get_client()
self.assertRaises(jsonrpclib.ProtocolError, client.private)
+ def test_order(self):
+ client = self.get_client()
+ self.assertEqual(client.testOrder(),
+ {'a': 1, 'b': 2, 'c': 3})
+ self.assertEqual(client.testOrder(a=10),
+ {'a': 10, 'b': 2, 'c': 3})
+ self.assertEqual(client.testOrder(c=10),
+ {'a': 1, 'b': 2, 'c': 10})
+ self.assertEqual(client.testOrder(a=10,b=11,c=12),
+ {'a': 10, 'b': 11, 'c': 12})
+

0 comments on commit 2991754

Please sign in to comment.