Xqt created this task.
Xqt added a project: Pywikibot-tests.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
Restricted Application added a project: Pywikibot.
TASK DESCRIPTION
=================================== FAILURES
===================================
____________ TestPropertyGenerator.test_many_continuations_limited
_____________
self = <tests.api_tests.TestPropertyGenerator
testMethod=test_many_continuations_limited>
def test_many_continuations_limited(self):
"""Test PropertyGenerator with many limited props."""
mainpage = self.get_mainpage()
links = list(self.site.pagelinks(mainpage, total=30))
titles = [link.title(with_section=False) for link in links]
params = {
'rvprop': 'ids|flags|timestamp|user|comment|content',
'titles': '|'.join(titles)}
if self.site.mw_version >= '1.32':
params['rvslots'] = 'main'
gen = api.PropertyGenerator(
site=self.site,
prop='revisions|info|categoryinfo|langlinks|templates',
parameters=params)
# An APIError is raised if set_maximum_items is not called.
gen.set_maximum_items(-1) # suppress use of "rvlimit" parameter
# Force the generator into continuation mode
gen.set_query_increment(5)
count = 0
for pagedata in gen:
self.assertIsInstance(pagedata, dict)
> self.assertIn('pageid', pagedata)
E AssertionError: 'pageid' not found in {'pagelanguagehtmlcode':
'en', 'ns': 0, 'pagelanguage': 'en', 'contentmodel': 'wikitext', 'missing': '',
'title': 'Catherine of Armagnac', 'pagelanguagedir': 'ltr'}
tests/api_tests.py:762: AssertionError
------------------------------ Captured log call
-------------------------------
VERBOSE pywiki:logging.py:101 PropertyGenerator: multiple requested query
modules support limits; using the first such module 'revisions' of
['revisions', 'info', 'categoryinfo', 'langlinks', 'templates']
_____________ TestPropertyGenerator.test_two_continuations_limited
_____________
self = <tests.api_tests.TestPropertyGenerator
testMethod=test_two_continuations_limited>
def test_two_continuations_limited(self):
"""Test PropertyGenerator with many limited props and
continuations."""
mainpage = self.get_mainpage()
links = list(self.site.pagelinks(mainpage, total=30))
titles = [link.title(with_section=False) for link in links]
gen = api.PropertyGenerator(
site=self.site, prop='info|categoryinfo|langlinks|templates',
parameters={'titles': '|'.join(titles)})
# Force the generator into continuation mode
gen.set_query_increment(5)
count = 0
for pagedata in gen:
self.assertIsInstance(pagedata, dict)
> self.assertIn('pageid', pagedata)
E AssertionError: 'pageid' not found in {'pagelanguagehtmlcode':
'en', 'ns': 0, 'pagelanguage': 'en', 'contentmodel': 'wikitext', 'missing': '',
'title': 'Catherine of Armagnac', 'pagelanguagedir': 'ltr'}
tests/api_tests.py:780: AssertionError
------------------------------ Captured log call
-------------------------------
VERBOSE pywiki:logging.py:101 PropertyGenerator: multiple requested query
modules support limits; using the first such module 'langlinks' of ['info',
'categoryinfo', 'langlinks', 'templates']
TASK DETAIL
https://phabricator.wikimedia.org/T272156
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: Aklapper, Xqt, pywikibot-bugs-list, JohnsonLee01, SHEKH, Dijkstra, Khutuck,
Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Altostratus,
Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs