mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Fixed bug in genre pluralization.
This commit is contained in:
parent
644eb1c248
commit
3e28059c9e
@ -68,10 +68,12 @@ class IMDB(callbacks.Privmsg):
|
|||||||
def _formatMovie(self, movie):
|
def _formatMovie(self, movie):
|
||||||
title = utils.unCommaThe(movie.title())
|
title = utils.unCommaThe(movie.title())
|
||||||
genres = utils.commaAndify(map(str.lower, movie.genres()))
|
genres = utils.commaAndify(map(str.lower, movie.genres()))
|
||||||
s = '"%s" (%s) belongs to the %s genres. ' \
|
s = '"%s" (%s) belongs to the %s %s. ' \
|
||||||
'It\'s been rated %s out of 10. ' \
|
'It\'s been rated %s out of 10. ' \
|
||||||
'More information is available at <%s>' % \
|
'More information is available at <%s>' % \
|
||||||
(title, movie.year(), genres, movie.rating(), movie.url)
|
(title, movie.year(), genres,
|
||||||
|
utils.pluralize(len(movie.genres()), 'genre'),
|
||||||
|
movie.rating(), movie.url)
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def imdb(self, irc, msg, args):
|
def imdb(self, irc, msg, args):
|
||||||
|
@ -35,8 +35,12 @@ class IMDBTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
plugins = ('IMDB',)
|
plugins = ('IMDB',)
|
||||||
def testImdb(self):
|
def testImdb(self):
|
||||||
self.assertNotError('imdb die hard')
|
self.assertNotError('imdb die hard')
|
||||||
m = self.getMsg('imdb kevin spacey')
|
self.assertRegexp('imdb kevin spacey', 'is apparently a person')
|
||||||
self.failUnless('is apparently a person' in m.args[1])
|
|
||||||
|
def testGenrePluralization(self):
|
||||||
|
self.assertNotRegexp('imdb 24', 'genres')
|
||||||
|
self.assertRegexp('imdb die hard', 'genres')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user