tag:blogger.com,1999:blog-34747147.post7120427708163224044..comments2016-01-06T00:43:45.007-08:00Comments on Task Coach: Testing translationsFrankhttp://www.blogger.com/profile/03326284039453250115noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-34747147.post-9877227725720349622007-09-10T11:55:00.000-07:002007-09-10T11:55:00.000-07:00Hi Joy, thanks for the new translation. I'll add i...Hi Joy, thanks for the new translation. I'll add it to the next release.<BR/><BR/>Thanks, FrankFrankhttps://www.blogger.com/profile/03326284039453250115noreply@blogger.comtag:blogger.com,1999:blog-34747147.post-67418876241819438682007-09-10T10:44:00.000-07:002007-09-10T10:44:00.000-07:00Hi, just want to let you know that I have created ...Hi, just want to let you know that I have created a Traditional Chinese translation for Task Coach on launchpad.net , please check it at URL "https://translations.launchpad.net/taskcoach/trunk/+pots/taskcoach/"<BR/>.<BR/><BR/>Thanks.Joey Weng Bloghttps://www.blogger.com/profile/07014003053050952293noreply@blogger.comtag:blogger.com,1999:blog-34747147.post-67738776409468108922007-09-01T09:01:00.000-07:002007-09-01T09:01:00.000-07:00Hi Calvin,Thanks for your comments. I agree that y...Hi Calvin,<BR/><BR/>Thanks for your comments. I agree that your solution is a bit simpler as you don't need to create new classes, but just add methods to an existing class. However, what I like about my solution is that the code that does the construction of the TestCase subclasses is separate from the test code. That way the tests are all in one place and the TestCase construction code could even be moved to a different module.<BR/><BR/>Cheers, FrankFrankhttps://www.blogger.com/profile/03326284039453250115noreply@blogger.comtag:blogger.com,1999:blog-34747147.post-91647786185272256522007-09-01T07:52:00.000-07:002007-09-01T07:52:00.000-07:00I think it would have been a lot simpler to create...I think it would have been a lot simpler to create an empty TestCase, and then after it doing a loop over the language and formatter combinations and for each combination doing something like this:<BR/><BR/>setattr(TranslationFormattingTestCase, 'test_%s_%s_%s" % (fromLang, toLang, formatter), lambda self: self.assertEqual(self.englishString.count(formatter),<BR/>self.translatedString.count(formatter))<BR/><BR/>Yes, using this technique you can even use the formatter directly in the method name, and unittest can pick it up just fine. A TestCase is more of a dictionary than a class in this fashion.Calvin Spealmanhttps://www.blogger.com/profile/07161631946662126734noreply@blogger.com