Page MenuHomePhabricator
Paste P3233

Design for tests/thanks_tests.py
ActivePublic

Authored by darthbhyrava on Jun 12 2016, 3:53 PM.
# -*- coding: utf-8 -*-
"""Test suite for the thanks script"""
#
# (C) Pywikibot team, 2016
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id:$'
import pywikibot
from scripts.thanks import thank_rev
from tests.aspects import unittest, TestCase
class TestThankedRevs(TestCase):
""" Test if the revisions are being thanked """
family = 'wikipedia'
code= 'en'
dry = true #should this be simulate = true?
def test_logging_enabled_rev(self):
"""Test if the thank action works for users with logging enabled"""
#The design of the following method:
# thank_rev(*some rev id*)
# thank_user_iD = "User whose revision is being thanked, and who has thanks enabled"
# thank_user = getUserfromId(thank_user_iD)
# if thank_user.thanks_enabled:
# page = Special:Log/thanks
# self.assert("revision present in page")
def test_logging_disabled_rev(self):
"""Test if the thank action works for users with logging disabled"""
#Design
#The design of the following method:
# thank_rev(*some rev id*)
# thank_user_iD = "User whose revision is being thanked, and who has thanks enabled"
# thank_user = getUserfromId(thank_user_iD)
# if (!thank_user.thanks_enabled):
# what now?
if __name__ == '__main__':
unittest.main()