jenkins-bot has submitted this change and it was merged.
Change subject: Added a test for the method newfiles ......................................................................
Added a test for the method newfiles
Change-Id: I2c6994add3834417c47d397f21125f2d03b57f53 --- M tests/site_tests.py 1 file changed, 12 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index 224f76d..f0e8468 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -554,6 +554,18 @@ self.assertTrue(mysite.page_exists(impage)) self.assertLessEqual(impage._imageinfo["size"], 2000)
+ def test_newfiles(self): + """Test the site.newfiles() method.""" + my_site = self.get_site() + the_list = list(my_site.newfiles(total=10)) + self.assertLessEqual(len(the_list), 10) + self.assertTrue(all(isinstance(tup, tuple) and len(tup) == 4 + for tup in the_list)) + self.assertTrue(all(isinstance(tup[0], pywikibot.FilePage) for tup in the_list)) + self.assertTrue(all(isinstance(tup[1], pywikibot.Timestamp) for tup in the_list)) + self.assertTrue(all(isinstance(tup[2], unicode) for tup in the_list)) + self.assertTrue(all(isinstance(tup[3], unicode) for tup in the_list)) + def testBlocks(self): """Test the site.blocks() method.""" mysite = self.get_site()
pywikibot-commits@lists.wikimedia.org