http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9194
Revision: 9194 Author: jayvdb Date: 2011-04-24 04:18:06 +0000 (Sun, 24 Apr 2011) Log Message: ----------- Add testcase for passing a list of titles
Modified Paths: -------------- trunk/pywikipedia/tests/test_query.py
Modified: trunk/pywikipedia/tests/test_query.py =================================================================== --- trunk/pywikipedia/tests/test_query.py 2011-04-24 04:05:14 UTC (rev 9193) +++ trunk/pywikipedia/tests/test_query.py 2011-04-24 04:18:06 UTC (rev 9194) @@ -32,7 +32,7 @@ ]} self.assertEqualQueryResult(params, expectedresult)
- def test_multi(self): + def test_titles_multi(self): params = { 'action': 'query', 'list': 'users', @@ -53,5 +53,26 @@ ]} self.assertEqualQueryResult(params, expectedresult)
+ def test_titles_list(self): + params = { + 'action': 'query', + 'list': 'users', + 'usprop': ['registration'], + 'ususers': [u'Example', u'Example2'], + } + expectedresult = {u'users': [ + { + u'userid': 215131, + u'name': u'Example', + u'registration': u'2005-03-19T00:17:19Z' + }, + { + u'userid': 5176706, + u'name': u'Example2', + u'registration': u'2007-08-26T02:13:33Z' + }, + ]} + self.assertEqualQueryResult(params, expectedresult) + if __name__ == "__main__": unittest.main()
pywikipedia-svn@lists.wikimedia.org