def _optional_author_string(self, author_emails): if not author_emails: return "" heading_string = plural( 'author') if len(author_emails) > 1 else 'author' authors_string = join_with_separators(sorted(author_emails)) return " (%s: %s)" % (heading_string, authors_string)
def _optional_author_string(self, author_emails): if not author_emails: return "" heading_string = plural('author') if len(author_emails) > 1 else 'author' authors_string = join_with_separators(sorted(author_emails)) return " (%s: %s)" % (heading_string, authors_string)
def test_plural(self): self.assertEqual(plural("patch"), "patches") self.assertEqual(plural("test"), "tests")