improve result output of a pelican run

*  display count of hidden pages
*  pluralize only if necessary
*  add maybe_pluralize to utils
*  add tests for maybe_pluralize
This commit is contained in:
derwinlu 2015-06-03 08:58:59 +02:00
commit 39fd4936b5
3 changed files with 50 additions and 7 deletions

View file

@ -358,6 +358,12 @@ class TestUtils(LoggedTestCase):
locale.setlocale(locale.LC_ALL, old_locale)
def test_maybe_pluralize(self):
self.assertEqual(utils.maybe_pluralize(0, 'Article', 'Articles'), '0 Articles')
self.assertEqual(utils.maybe_pluralize(1, 'Article', 'Articles'), '1 Article')
self.assertEqual(utils.maybe_pluralize(2, 'Article', 'Articles'), '2 Articles')
class TestCopy(unittest.TestCase):
'''Tests the copy utility'''