jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] logentry.page() may return an int value ......................................................................
[bugfix] logentry.page() may return an int value
BlockEntry instance method page() may return an int value when isAutoblockRemoval is True
Change-Id: I2c6f65c7241bd9f8e3648abc876c2aebbbc3e9d3 --- M tests/logentry_tests.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py index 77c0d88..d48c9fc 100644 --- a/tests/logentry_tests.py +++ b/tests/logentry_tests.py @@ -82,7 +82,10 @@ self.assertIsInstance(logentry.pageid(), int) self.assertIsInstance(logentry.timestamp(), pywikibot.Timestamp) if 'title' in logentry.data: # title may be missing - self.assertIsInstance(logentry.page(), pywikibot.Page) + if logtype == 'block' and logentry.isAutoblockRemoval: + self.assertIsInstance(logentry.page(), int) + else: + self.assertIsInstance(logentry.page(), pywikibot.Page) else: self.assertRaises(KeyError, logentry.page) self.assertEqual(logentry.type(), logtype)
pywikibot-commits@lists.wikimedia.org