Exemple #1
0
    def test_remove_header_rule_ham(self):
        line = "ham Test"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._add_header_rule(line, remove=True)

        result = ruleset.header_mod["ham"][0]
        self.assertEqual(result, (True, "X-Spam-Test", None))
Exemple #2
0
    def test_add_header_rule_ham(self):
        line = "ham Test my value"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._add_header_rule(line, remove=False)

        result = ruleset.header_mod["ham"][0]
        self.assertEqual(result, (False, "X-Spam-Test", "my value"))
Exemple #3
0
    def test_remove_header_rule_ham(self):
        line = "ham Test"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._add_header_rule(line, remove=True)

        result = ruleset.header_mod["ham"][0]
        self.assertEqual(result, (True, "X-Spam-Test", None))
Exemple #4
0
    def test_add_header_rule_ham(self):
        line = "ham Test my value"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)
        ruleset._add_header_rule(line, remove=False)

        result = ruleset.header_mod["ham"][0]
        self.assertEqual(result, (False, "X-Spam-Test", "my value"))
Exemple #5
0
    def test_remove_header_rule_invalid(self):
        line = "bam Test"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)

        with self.assertRaises(pad.errors.InvalidRule):
            ruleset._add_header_rule(line, remove=True)
Exemple #6
0
    def test_remove_header_rule_invalid(self):
        line = "bam Test"
        ruleset = pad.rules.ruleset.RuleSet(self.mock_ctxt)

        with self.assertRaises(pad.errors.InvalidRule):
            ruleset._add_header_rule(line, remove=True)