Page MenuHomePhabricator
Paste P3263 v3.0

Authored by darthbhyrava on Jun 17 2016, 12:37 AM.
# -*- coding: utf-8 -*-
"""Test suite for the thanks script"""
# (C) Pywikibot team, 2016
# Distributed under the terms of the MIT license.
from __future__ import absolute_import, unicode_literals
import pywikibot
from scripts.thanks import thank_rev
from tests.aspects import unittest, TestCase
class TestRevThank(TestCase):
"""Test thanks for revisions."""
family = 'test'
code = 'test'
def test_thank_revision(self):
Test thanks for normal revisions.
NOTE: This test relies on activity in recentchanges, and
there must make edits made before reruns of this test.
Please see
site = pywikibot.Site()
data = site.recentchanges(total=1)
for i in data:
rev_id = i['revid']
log_initial = site.logevents(logtype='thanks', total=1)
for x in log_initial:
initial_id = x.logid()
log_final = site.logevents(logtype='thanks', total=1)
for x in log_final:
final_id = x.logid()
if __name__ == "__main__":