Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 7066:27c2d7295ba2
Changes from review
mailgw script was still using usage()
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Wed, 23 Nov 2022 21:16:01 +0100 |
| parents | 3359dc1dabb0 |
| children | 86862ed039fa |
comparison
equal
deleted
inserted
replaced
| 7065:48da482d7d93 | 7066:27c2d7295ba2 |
|---|---|
| 241 self.db.security.getPermission('Create', 'issue'), | 241 self.db.security.getPermission('Create', 'issue'), |
| 242 self.db.security.getPermission('Create', 'msg'), | 242 self.db.security.getPermission('Create', 'msg'), |
| 243 ] | 243 ] |
| 244 self.db.security.role['anonymous'].permissions = p | 244 self.db.security.role['anonymous'].permissions = p |
| 245 | 245 |
| 246 def _create_mailgw(self, message, args=[]): | 246 def _create_mailgw(self, message, args=()): |
| 247 class MailGW(self.instance.MailGW): | 247 class MailGW(self.instance.MailGW): |
| 248 """call _handle_message as handle_message | 248 """call _handle_message as handle_message |
| 249 the real handle_message reopens the database, and destroys | 249 the real handle_message reopens the database, and destroys |
| 250 the db that we supply as part of the test. | 250 the db that we supply as part of the test. |
| 251 """ | 251 """ |
| 254 cmd, parsed_args = parse_arguments (args) | 254 cmd, parsed_args = parse_arguments (args) |
| 255 handler = MailGW(self.instance, parsed_args) | 255 handler = MailGW(self.instance, parsed_args) |
| 256 handler.db = self.db | 256 handler.db = self.db |
| 257 return handler | 257 return handler |
| 258 | 258 |
| 259 def _handle_mail(self, message, args=[], trap_exc=0): | 259 def _handle_mail(self, message, args=(), trap_exc=0): |
| 260 handler = self._create_mailgw(message, args) | 260 handler = self._create_mailgw(message, args) |
| 261 handler.trapExceptions = trap_exc | 261 handler.trapExceptions = trap_exc |
| 262 return handler.main(io.BytesIO(s2b(message))) | 262 return handler.main(io.BytesIO(s2b(message))) |
| 263 | 263 |
| 264 def _get_mail(self): | 264 def _get_mail(self): |
