Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P3233
Design for tests/thanks_tests.py
Active
Public
Actions
Authored by
darthbhyrava
on Jun 12 2016, 3:53 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
Pywikibot-Thanks
Referenced Files
F4157824: Design for tests/thanks_tests.py
Jun 12 2016, 3:53 PM
2016-06-12 15:53:53 (UTC+0)
Subscribers
darthbhyrava
jayvdb
Legoktm
# -*- 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
()
Event Timeline
darthbhyrava
created this paste.
Jun 12 2016, 3:53 PM
2016-06-12 15:53:53 (UTC+0)
darthbhyrava
mentioned this in
T137462: GSoC: Pywikibot-Thanks | Meeting 5 | 10th June
.
Log In to Comment