jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/768198 )
Change subject: [tests] Remove sysop TestCase attribute ......................................................................
[tests] Remove sysop TestCase attribute
- 'sysop' attribute was replaced by rights attribute an can be dropped. - 'user' attribute was renamed to 'login' already - restore old test_delete because https://gerrit.wikimedia.org/r/c/pywikibot/core/+/271980 never worked
Bug: T71283 Change-Id: Ieacab7522d73931d4bb2178b6cbf681543e5f161 --- M tests/aspects.py M tests/deletionbot_tests.py M tests/page_tests.py 3 files changed, 9 insertions(+), 14 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py index 59a7748..b1b601a 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -556,9 +556,6 @@ """ super().setUpClass()
- # currently 'sysop' attribute is an alias for 'login' - # sysop = hasattr(cls, 'sysop') and cls.sysop - for site_dict in cls.sites.values(): cls.require_site_user(site_dict['family'], site_dict['code'])
@@ -711,8 +708,8 @@ # Inherit superclass attributes for base in bases: for key in ('cached', 'code', 'dry', 'family', 'hostname', - 'hostnames', 'net', 'oauth', 'pwb', 'site', 'sites', - 'rights', 'sysop', 'user', 'wikibase', 'write'): + 'hostnames', 'login', 'net', 'oauth', 'pwb', 'site', + 'sites', 'rights', 'wikibase', 'write'): if hasattr(base, key) and key not in dct: dct[key] = getattr(base, key)
@@ -812,7 +809,7 @@ bases = cls.add_base(bases, NeedRightsMixin) dct.setdefault('login', True)
- if dct.get('login') or dct.get('sysop'): + if dct.get('login'): bases = cls.add_base(bases, RequireLoginMixin)
for test in tests: diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py index 0e5b39f..a82e126 100644 --- a/tests/deletionbot_tests.py +++ b/tests/deletionbot_tests.py @@ -50,12 +50,11 @@
class TestDeletionBotUser(ScriptMainTestCase):
- """Test deletionbot as a user (not sysop).""" + """Test deletionbot as a user (no 'deletion' right)."""
family = 'wikipedia' code = 'test'
- login = True write = True
def test_delete_mark(self): diff --git a/tests/page_tests.py b/tests/page_tests.py index 8a1319b..d6196ae 100644 --- a/tests/page_tests.py +++ b/tests/page_tests.py @@ -1008,7 +1008,7 @@ code = 'test'
write = True - sysop = True + rights = 'delete'
def test_delete(self): """Test the site.delete and site.undelete method.""" @@ -1016,12 +1016,11 @@ p = pywikibot.Page(site, 'User:Unicodesnowman/DeleteTest') # Ensure the page exists p.text = 'pywikibot unit test page' - p.save('#redirect[[unit test]]', botflag=True) - self.assertTrue(p.isRedirectPage()) + p.save('Pywikibot unit test', botflag=True) + # Test deletion - p.delete(reason='pywikibot unit test', prompt=False, mark=False) + p.delete(reason='Pywikibot unit test', prompt=False, mark=False) self.assertEqual(p._pageid, 0) - self.assertFalse(p.isRedirectPage()) with self.assertRaisesRegex(NoPageError, NO_PAGE_RE): p.get(force=True)
@@ -1032,7 +1031,7 @@ p.markDeletedRevision(del_revs[-2]) with self.assertRaisesRegex(ValueError, 'is not a deleted revision'): p.markDeletedRevision(123) - p.undelete(reason='pywikibot unit test') + p.undelete(reason='Pywikibot unit test') revs = list(p.revisions()) self.assertLength(revs, 2) self.assertEqual(revs[1].revid, revid)
pywikibot-commits@lists.wikimedia.org