jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/768292 )
Change subject: [tests] Fix cache_tests.py ......................................................................
[tests] Fix cache_tests.py
LoginStatus enum does not have an entry above 1 currently, user LoginStatus.AS_USER to test for username.
Change-Id: Iecf44f8f514e5ae48c85174813725ef7c4f93368 --- M tests/cache_tests.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/cache_tests.py b/tests/cache_tests.py index e5d489e..7ddb229 100644 --- a/tests/cache_tests.py +++ b/tests/cache_tests.py @@ -7,8 +7,11 @@ # import unittest
-import scripts.maintenance.cache as cache from pywikibot.site import BaseSite +from pywikibot.login import LoginStatus + +import scripts.maintenance.cache as cache + from tests import join_cache_path from tests.aspects import TestCase
@@ -24,7 +27,7 @@ self.assertIsInstance(entry.site, BaseSite) self.assertIsInstance(entry.site._loginstatus, int) self.assertNotIsInstance(entry.site._username, list) - if entry.site._loginstatus >= 1: + if entry.site._loginstatus >= LoginStatus.AS_USER: self.assertIsNotNone(entry.site._username) self.assertIsInstance(entry._params, dict) self.assertIsNotNone(entry._params)
pywikibot-commits@lists.wikimedia.org