jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] wikistats_tests: Assert unicode ......................................................................
[IMPROV] wikistats_tests: Assert unicode
Require that the returned total is a unicode type. This was separated from 6208baa3 as it changes the requirement of the test.
Change-Id: Ic7c48b868f2c3d6083b9157d6f1e8d1a033f0d81 --- M tests/wikistats_tests.py 1 file changed, 2 insertions(+), 6 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/wikistats_tests.py b/tests/wikistats_tests.py index 883c146..4d59623 100644 --- a/tests/wikistats_tests.py +++ b/tests/wikistats_tests.py @@ -10,14 +10,10 @@ __version__ = '$Id$' #
-import sys - from pywikibot.data.wikistats import WikiStats, csv +from pywikibot.tools import UnicodeType
from tests.aspects import unittest, TestCase - -if sys.version_info[0] == 3: - basestring = (str, )
class WikiStatsTestCase(TestCase): @@ -34,7 +30,7 @@ self.assertIn('prefix', top) self.assertIn('total', top) self.assertEqual(top['prefix'], 'en') - self.assertIsInstance(top['total'], basestring) + self.assertIsInstance(top['total'], UnicodeType) self.assertEqual(ws.languages_by_size('wikipedia')[0], 'en') self.assertEqual(ws.languages_by_size('wikisource')[0], 'fr')