diff options
| author | Aurélien Bompard | 2016-02-02 18:10:18 +0100 |
|---|---|---|
| committer | Barry Warsaw | 2016-02-29 21:52:13 -0500 |
| commit | 994660913bbd7dc08b8cef909b6715f43d37f0d5 (patch) | |
| tree | d17930b6d325f2d785883dc17ea71cf6eaef848f /src/mailman/model/tests | |
| parent | 9bf90986117e39450ec5bf1f86d29e5ed91f480d (diff) | |
| download | mailman-994660913bbd7dc08b8cef909b6715f43d37f0d5.tar.gz mailman-994660913bbd7dc08b8cef909b6715f43d37f0d5.tar.zst mailman-994660913bbd7dc08b8cef909b6715f43d37f0d5.zip | |
Rename the HeaderMatch.chain column to action
It makes it clearer what values are valid, and allows validation.
Diffstat (limited to 'src/mailman/model/tests')
| -rw-r--r-- | src/mailman/model/tests/test_mailinglist.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mailman/model/tests/test_mailinglist.py b/src/mailman/model/tests/test_mailinglist.py index 1431b1be8..61ab0901d 100644 --- a/src/mailman/model/tests/test_mailinglist.py +++ b/src/mailman/model/tests/test_mailinglist.py @@ -30,6 +30,7 @@ import unittest from mailman.app.lifecycle import create_list from mailman.config import config from mailman.database.transaction import transaction +from mailman.interfaces.action import Action from mailman.interfaces.listmanager import IListManager from mailman.interfaces.mailinglist import ( IAcceptableAliasSet, IHeaderMatchList, IListArchiverSet) @@ -205,11 +206,11 @@ class TestHeaderMatch(unittest.TestCase): self.assertEqual(len(self._mlist.header_matches), 1) self.assertEqual(self._mlist.header_matches[0].header, 'header') - def test_chain_defaults_to_none(self): + def test_action_defaults_to_none(self): header_matches = IHeaderMatchList(self._mlist) header_matches.append('header', 'pattern') self.assertEqual(len(self._mlist.header_matches), 1) - self.assertEqual(self._mlist.header_matches[0].chain, None) + self.assertEqual(self._mlist.header_matches[0].action, None) def test_duplicate(self): header_matches = IHeaderMatchList(self._mlist) @@ -240,16 +241,16 @@ class TestHeaderMatch(unittest.TestCase): header_matches = IHeaderMatchList(self._mlist) header_matches.append('Header', 'pattern') header_matches.append('Subject', 'patt.*') - header_matches.append('From', '.*@example.com', 'discard') - header_matches.append('From', '.*@example.org', 'accept') - matches = [(match.header, match.pattern, match.chain) + header_matches.append('From', '.*@example.com', Action.discard) + header_matches.append('From', '.*@example.org', Action.accept) + matches = [(match.header, match.pattern, match.action) for match in IHeaderMatchList(self._mlist)] self.assertEqual( matches, [ ('header', 'pattern', None), ('subject', 'patt.*', None), - ('from', '.*@example.com', 'discard'), - ('from', '.*@example.org', 'accept'), + ('from', '.*@example.com', Action.discard), + ('from', '.*@example.org', Action.accept), ]) def test_clear(self): |
