jenkins-bot merged this change.
[tests] skip ns() and pageid() tests when 'title' key is missing
We can assume that 'ns' and 'pageid' key is missing
when the 'title' is hidden
Bug: T191145
Change-Id: Ib9bd2e7f99c614b278c6a8b0cc6367127a73edcf
---
M tests/logentry_tests.py
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/logentry_tests.py b/tests/logentry_tests.py
index 50f900a..51d6cc3 100644
--- a/tests/logentry_tests.py
+++ b/tests/logentry_tests.py
@@ -80,10 +80,10 @@
except KeyError as e:
self.assertRegex(str(e), "Log entry ([^)]+) has no 'comment' key")
self.assertIsInstance(logentry.logid(), int)
- self.assertIsInstance(logentry.ns(), int)
- self.assertIsInstance(logentry.pageid(), int)
self.assertIsInstance(logentry.timestamp(), pywikibot.Timestamp)
if 'title' in logentry.data: # title may be missing
+ self.assertIsInstance(logentry.ns(), int)
+ self.assertIsInstance(logentry.pageid(), int)
if logtype == 'block' and logentry.isAutoblockRemoval:
self.assertIsInstance(logentry.page(), int)
elif isinstance(logentry, UserTargetLogEntry):
To view, visit change 423255. To unsubscribe, visit settings.