@@ -0,0 +1,1965 @@
+# -*- coding: utf-8 -*-%0A%22%22%22Tests for thanks reporting bot code.%22%22%22%0A#%0A# (C) Alexander Jones, 2017%0A#%0A# Distributed under the terms of the MIT license.%0A#%0Afrom __future__ import absolute_import, unicode_literals%0A%0Aimport pywikibot%0Afrom pywikibot import User%0A%0Afrom scripts.thanks_report import ThanksReportBot%0A%0Afrom unittest.case import TestCase%0A%0A%0Aclass TestThanksReportBot(TestCase):%0A%0A    %22%22%22Base class for per-wiki test classes.%22%22%22%0A%0A    def _thanks_for_month(self, year, month, good_data, min_actions=1):%0A        %22%22%22Test the thanks report for a given month.%22%22%22%0A        bot = ThanksReportBot(year=year, month=month,%0A                              minimum_actions=min_actions)%0A        bot.site = pywikibot.Site(fam=self.family, code=self.code)%0A        (good_thankers, good_thankees_with_strings) = good_data%0A        good_thankees = %7B%7D%0A        for k,v in good_thankees_with_strings.items():%0A            good_thankees%5BUser(bot.site, k)%5D = v%0A        (pulled_thankers, pulled_thankees) = bot.gather()%0A        self.assertDictContainsSubset(good_thankers, pulled_thankers,%0A                                      'Bad thankers report')%0A        self.assertDictContainsSubset(good_thankees, pulled_thankees,%0A                                      'Bad thankees report')%0A%0A%0Aclass TestOutreachThanks(TestThanksReportBot):%0A%0A    %22%22%22Test the thanks report with outreach.%22%22%22%0A%0A    family = 'outreach'%0A    code = 'outreach'%0A%0A    def test_August2016(self):%0A        %22%22%22Test on outreach using data from August 2016.%22%22%22%0A        good_data = %5B%0A            %7B'Romaine': 20, 'Msannakoval': 13, 'Joalpe': 3, 'TFlanagan-WMF': 3,%0A             'Masssly': 3, 'PetrohsW': 2, 'Halibutt': 2, 'VIGNERON': 1,%0A             'MCruz (WMF)': 1, 'Slowking4': 1%7D,%0A            %7B'Loreen.Ruiz': 5, 'Koavf': 4, 'Msannakoval': 3, 'Andycyca': 3,%0A             'Sadads': 2, 'L%C3%A9na': 2, 'AKoval (WMF)': 2, 'Masssly': 2,%0A             'Pigsonthewing': 1, 'Ijon': 1%7D%0A        %5D%0A        self._thanks_for_month(2016, 8, good_data, 1)%0A

Add test case