Esempio n. 1
0
    def test_adjust_headers_remove(self):
        rules = [(True, "X-Spam-Test", None)]
        mock_msg = MagicMock(interpolate_data={"TEST": "test"})
        newmsg = MagicMock()
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._adjust_headers(mock_msg, newmsg, rules)

        newmsg.__delitem__.assert_called_with("X-Spam-Test")
Esempio n. 2
0
    def test_adjust_headers_remove(self):
        rules = [(True, "X-Spam-Test", None)]
        mock_msg = MagicMock(interpolate_data={"TEST": "test"})
        newmsg = MagicMock()
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._adjust_headers(mock_msg, newmsg, rules)

        newmsg.__delitem__.assert_called_with("X-Spam-Test")
Esempio n. 3
0
    def test_adjust_headers(self):
        rules = [(False, "X-Spam-Test", "value")]
        mock_msg = MagicMock(interpolate_data={"TEST": "test"})
        newmsg = MagicMock()
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._adjust_headers(mock_msg, newmsg, rules)

        newmsg.add_header.assert_called_with("X-Spam-Test", "value")
Esempio n. 4
0
    def test_adjust_headers(self):
        rules = [(False, "X-Spam-Test", "value")]
        mock_msg = MagicMock(interpolate_data={"TEST": "test"})
        newmsg = MagicMock()
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._adjust_headers(mock_msg, newmsg, rules)

        newmsg.add_header.assert_called_with("X-Spam-Test", "value")