Skip to content

Commit e305dab

Browse files
committed
Implement XMLRPC MultiCall (including test), see
http://docs.python.org/2/library/xmlrpclib.html#xmlrpclib.MultiCall
1 parent edc8f23 commit e305dab

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

CHANGES.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Features:
5151
client.selectTemplate (anatoly techtonik)
5252
- Increased generated password length to 12 symbols to slow down GPGPU
5353
attacks (anatoly techtonik)
54+
- Implement XMLRPC MultiCall (including test), see
55+
http://docs.python.org/2/library/xmlrpclib.html#xmlrpclib.MultiCall
56+
(Ralf Schlatterbeck)
5457

5558
Fixed:
5659

@@ -66,7 +69,7 @@ Fixed:
6669
(Pradip Caulagi)
6770
- [minor] Template responsive: make demo.py work out of the box with it,
6871
by setting the static_files config.ini setting to "static".
69-
Footer: link fixed and hardcoded last modfied date removed. (Bernhard Reiter)
72+
Footer: link fixed and hardcoded last modified date removed. (Bernhard Reiter)
7073
- demo.py print location of tracker home and fully erase its directory
7174
when nuking (anatoly techtonik)
7275
- demo.py changing hostname in config.ini actually changes the address

roundup/xmlrpc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def __init__(self, db, actions, translator,
198198
# python2.4
199199
SimpleXMLRPCDispatcher.__init__(self)
200200
self.register_instance(RoundupInstance(db, actions, translator))
201+
self.register_multicall_functions()
201202

202203

203204
def dispatch(self, input):

test/test_xmlrpc.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
import unittest, os, shutil, errno, sys, difflib, cgi, re
88

9+
from xmlrpclib import MultiCall
910
from roundup.cgi.exceptions import *
1011
from roundup import init, instance, password, hyperdb, date
11-
from roundup.xmlrpc import RoundupInstance
12+
from roundup.xmlrpc import RoundupInstance, RoundupDispatcher
1213
from roundup.backends import list_backends
1314
from roundup.hyperdb import String
15+
from roundup.cgi import TranslationService
1416

1517
import db_test_base
1618

@@ -221,6 +223,31 @@ def testAuthFilter(self):
221223
r = self.server.filter('issue', None, {}, group=keygroup)
222224
self.assertEqual(r, ['2', '3', '1'])
223225

226+
def testMulticall(self):
227+
translator = TranslationService.get_translation(
228+
language=self.instance.config["TRACKER_LANGUAGE"],
229+
tracker_home=self.instance.config["TRACKER_HOME"])
230+
self.server = RoundupDispatcher(self.db, self.instance.actions,
231+
translator, allow_none = True)
232+
class S:
233+
multicall=self.server.funcs['system.multicall']
234+
self.server.system = S()
235+
self.db.issue.create(title='i1')
236+
self.db.issue.create(title='i2')
237+
m = MultiCall(self.server)
238+
m.display('issue1')
239+
m.display('issue2')
240+
result = m()
241+
results = [
242+
{'files': [], 'status': '1', 'tx_Source': 'web',
243+
'keyword': [], 'title': 'i1', 'nosy': [], 'messages': [],
244+
'priority': None, 'assignedto': None, 'superseder': []},
245+
{'files': [], 'status': '1', 'tx_Source': 'web',
246+
'keyword': [], 'title': 'i2', 'nosy': [], 'messages': [],
247+
'priority': None, 'assignedto': None, 'superseder': []}]
248+
for n, r in enumerate(result):
249+
self.assertEqual(r, results[n])
250+
224251
def test_suite():
225252
suite = unittest.TestSuite()
226253
for l in list_backends():

0 commit comments

Comments
 (0)