jenkins-bot has submitted this change and it was merged.
Change subject: Mark setAction method as deprecated
......................................................................
Mark setAction method as deprecated
comment parameter for page saving methods should be used instead
Change-Id: I80db495c7d52b7fda96e76219dc5c573cfa0a446
---
M pywikibot/__init__.py
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Ricordisamoa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 7826fec..c9594e4 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -489,6 +489,7 @@
link_regex = re.compile(r'\[\[(?P<title>[^\]|[<>{}]*)(\|.*?)?\]\]')
+@deprecated("comment parameter for page saving method")
def setAction(s):
"""Set a summary to use for changed page submissions"""
config.default_edit_summary = s
--
To view, visit https://gerrit.wikimedia.org/r/137285
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I80db495c7d52b7fda96e76219dc5c573cfa0a446
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: Russell Blau <russblau(a)imapmail.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Pywikipediabot -> Pywikibot
......................................................................
Pywikipediabot -> Pywikibot
Change-Id: I241b2372d272956cbd76e009bffc88b4b81b9a94
---
M families/README-family.txt
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/families/README-family.txt b/families/README-family.txt
index 979a3aa..24be66b 100644
--- a/families/README-family.txt
+++ b/families/README-family.txt
@@ -1,6 +1,6 @@
How to create a new family file to add a new wiki to the bot framework.
-(c) 2008-2013, the Pywikipediabot team
+(c) 2008-2014, the Pywikibot team
First of all, run generate_family_file.py, and see if this works. If it doesn't,
please read the text below and check the example.
--
To view, visit https://gerrit.wikimedia.org/r/137689
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I241b2372d272956cbd76e009bffc88b4b81b9a94
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Progressing dots to show test is running
......................................................................
Progressing dots to show test is running
- use a metaclass for this test
- register all tests in different methods and run them
separately
This test may be called by unittest.main() whereas the previous test
needs unittest.TextTestRunner which isn't called by the automatic
testing.
Change-Id: I01b3a7ca47ec7fcc3adf02285c803e934c67d52e
Original-Change-Id: I30a7256f2b87e7e8a348731526e2d36b42a86f9a
---
M tests/date_tests.py
1 file changed, 41 insertions(+), 23 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/date_tests.py b/tests/date_tests.py
index 730c5b3..932b409 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -10,30 +10,48 @@
from pywikibot import date
+class TestDateMeta(type):
+ """Test meta class"""
+
+ def __new__(cls, name, bases, dct):
+ """create the new class"""
+
+ def test_method(formatname):
+
+ def testMapEntry(self):
+ """The test ported from date.py"""
+ step = 1
+ if formatname in date.decadeFormats:
+ step = 10
+ try:
+ predicate, start, stop = date.formatLimits[formatname]
+ except KeyError:
+ return
+
+ for code, convFunc in date.formats[formatname].items():
+ for value in range(start, stop, step):
+ self.assertTrue(
+ predicate(value),
+ "date.formats['%(formatname)s']['%(code)s']:\n"
+ "invalid value %(value)d" % locals())
+
+ newValue = convFunc(convFunc(value))
+ self.assertEqual(
+ newValue, value,
+ "date.formats['%(formatname)s']['%(code)s']:\n"
+ "value %(newValue)d does not match %(value)s"
+ % locals())
+ return testMapEntry
+
+ for formatname in date.formats:
+ test_name = "test_" + formatname
+ dct[test_name] = test_method(formatname)
+ return type.__new__(cls, name, bases, dct)
+
+
class TestDate(unittest.TestCase):
- """Test cases for date library"""
-
- def testMapEntry(self):
- """Test the validity of the pywikibot.date format maps."""
- for formatName in date.formats:
- step = 1
- if formatName in date.decadeFormats:
- step = 10
- predicate, start, stop = date.formatLimits[formatName]
-
- for code, convFunc in date.formats[formatName].items():
- for value in range(start, stop, step):
- self.assertTrue(
- predicate(value),
- "date.formats['%(formatName)s']['%(code)s']:\n"
- "invalid value %(value)d" % locals())
-
- newValue = convFunc(convFunc(value))
- self.assertEqual(
- newValue, value,
- "date.formats['%(formatName)s']['%(code)s']:\n"
- "value %(newValue)d does not match %(value)s"
- % locals())
+ """Test cases for date library processed by unittest"""
+ __metaclass__ = TestDateMeta
if __name__ == '__main__':
--
To view, visit https://gerrit.wikimedia.org/r/137365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I01b3a7ca47ec7fcc3adf02285c803e934c67d52e
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Progressing dots to show test is running"
......................................................................
Revert "Progressing dots to show test is running"
Breaks tests; https://travis-ci.org/wikimedia/pywikibot-core/builds/26752150
This reverts commit 93379dbf499c58438917728b74862f282c15dba4.
Change-Id: Iacb4cc9e6999d265b46c558ed3999c1198f87de0
---
M tests/date_tests.py
1 file changed, 20 insertions(+), 34 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/date_tests.py b/tests/date_tests.py
index 835f38b..730c5b3 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -13,45 +13,31 @@
class TestDate(unittest.TestCase):
"""Test cases for date library"""
- def __init__(self, formatname):
- super(TestDate, self).__init__()
- self.formatname = formatname
+ def testMapEntry(self):
+ """Test the validity of the pywikibot.date format maps."""
+ for formatName in date.formats:
+ step = 1
+ if formatName in date.decadeFormats:
+ step = 10
+ predicate, start, stop = date.formatLimits[formatName]
- def testMapEntry(self, formatname):
- """The test ported from date.py"""
- step = 1
- if formatname in date.decadeFormats:
- step = 10
- predicate, start, stop = date.formatLimits[formatname]
+ for code, convFunc in date.formats[formatName].items():
+ for value in range(start, stop, step):
+ self.assertTrue(
+ predicate(value),
+ "date.formats['%(formatName)s']['%(code)s']:\n"
+ "invalid value %(value)d" % locals())
- for code, convFunc in date.formats[formatname].items():
- for value in range(start, stop, step):
- self.assertTrue(
- predicate(value),
- "date.formats['%(formatname)s']['%(code)s']:\n"
- "invalid value %(value)d" % locals())
-
- newValue = convFunc(convFunc(value))
- self.assertEqual(
- newValue, value,
- "date.formats['%(formatname)s']['%(code)s']:\n"
- "value %(newValue)d does not match %(value)s"
- % locals())
-
- def runTest(self):
- """method called by unittest"""
- self.testMapEntry(self.formatname)
-
-
-def suite():
- """Setup the test suite and register all test to different instances"""
- suite = unittest.TestSuite()
- suite.addTests(TestDate(formatname) for formatname in date.formats)
- return suite
+ newValue = convFunc(convFunc(value))
+ self.assertEqual(
+ newValue, value,
+ "date.formats['%(formatName)s']['%(code)s']:\n"
+ "value %(newValue)d does not match %(value)s"
+ % locals())
if __name__ == '__main__':
try:
- unittest.TextTestRunner().run(suite())
+ unittest.main()
except SystemExit:
pass
--
To view, visit https://gerrit.wikimedia.org/r/137364
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iacb4cc9e6999d265b46c558ed3999c1198f87de0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>