Mercurial > p > roundup > code
comparison test/test_mailgw.py @ 7234:86862ed039fa
issue2551262 - make mail gateway subject prefix parsing accept spaces
Allow spaces before/after prefix. Also allow spaces between classname
and id number in prefix designator. So "[ issue 23 ] subject" is
parsed like "[issue23] subject".
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 21 Mar 2023 19:46:38 -0400 |
| parents | 27c2d7295ba2 |
| children | cde2b45d599a |
comparison
equal
deleted
inserted
replaced
| 7233:f5e676c4383d | 7234:86862ed039fa |
|---|---|
| 4288 ''') | 4288 ''') |
| 4289 | 4289 |
| 4290 assert not os.path.exists(SENDMAILDEBUG) | 4290 assert not os.path.exists(SENDMAILDEBUG) |
| 4291 self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') | 4291 self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') |
| 4292 | 4292 |
| 4293 def testSpacedPrefixSubject(self): | |
| 4294 self.db.keyword.create(name='Foo') | |
| 4295 self._handle_mail('''Content-Type: text/plain; | |
| 4296 charset="iso-8859-1" | |
| 4297 From: Chef <chef@bork.bork.bork> | |
| 4298 To: issue_tracker@your.tracker.email.domain.example | |
| 4299 Subject: VeryStrangeRe: [ keyword 1 ] Testing.. [name=Bar] | |
| 4300 Cc: richard@test.test | |
| 4301 Reply-To: chef@bork.bork.bork | |
| 4302 Message-Id: <dummy_test_message_id> | |
| 4303 | |
| 4304 ''') | |
| 4305 assert not os.path.exists(SENDMAILDEBUG) | |
| 4306 self.assertEqual(self.db.keyword.get('1', 'name'), 'Bar') | |
| 4307 | |
| 4293 def testUnknownPrefixSubject(self): | 4308 def testUnknownPrefixSubject(self): |
| 4294 self.db.keyword.create(name='Foo') | 4309 self.db.keyword.create(name='Foo') |
| 4295 self._handle_mail('''Content-Type: text/plain; | 4310 self._handle_mail('''Content-Type: text/plain; |
| 4296 charset="iso-8859-1" | 4311 charset="iso-8859-1" |
| 4297 From: Chef <chef@bork.bork.bork> | 4312 From: Chef <chef@bork.bork.bork> |
