jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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)

To view, visit change 768292. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Iecf44f8f514e5ae48c85174813725ef7c4f93368
Gerrit-Change-Number: 768292
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged