Xqt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/159488
Change subject: return a DummySiteinfo instance with siteinfo property
......................................................................
return a DummySiteinfo instance with siteinfo property
- do not instanciate DummySiteinfo for every siteinfo call
but return the instance establish once before. This enables
to set values to the DummySiteinfo cache.
Change-Id: I9e003f0c3c98a1ffe2116e03c5019527c3cfea6c
---
M tests/dry_site_tests.py
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/88/159488/1
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 839efb5..ed4a0ac 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -18,13 +18,18 @@
class DrySite(pywikibot.site.APISite):
_loginstatus = pywikibot.site.LoginStatus.NOT_ATTEMPTED
+ def __init__(self, *args):
+ """Constructor: instanciate DummySiteinfo only once"""
+ super(DrySite, self).__init__(*args)
+ self._dummy_si = DummySiteinfo({})
+
@property
def userinfo(self):
return self._userinfo
@property
def siteinfo(self):
- return DummySiteinfo({})
+ return self._dummy_si
class TestDrySite(TestCase):
--
To view, visit https://gerrit.wikimedia.org/r/159488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e003f0c3c98a1ffe2116e03c5019527c3cfea6c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits