mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +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):
|
||||
title = utils.unCommaThe(movie.title())
|
||||
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. ' \
|
||||
'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
|
||||
|
||||
def imdb(self, irc, msg, args):
|
||||
|
@ -35,8 +35,12 @@ class IMDBTestCase(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('IMDB',)
|
||||
def testImdb(self):
|
||||
self.assertNotError('imdb die hard')
|
||||
m = self.getMsg('imdb kevin spacey')
|
||||
self.failUnless('is apparently a person' in m.args[1])
|
||||
self.assertRegexp('imdb kevin spacey', 'is apparently a person')
|
||||
|
||||
def testGenrePluralization(self):
|
||||
self.assertNotRegexp('imdb 24', 'genres')
|
||||
self.assertRegexp('imdb die hard', 'genres')
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user