def test_make_link_with_chain(self): # Test that make_link() with a given chain creates a Link with a jump # action to the chain. link = make_link('Subject', '[tT]esting', 'accept') self.assertEqual(link.rule.header, 'Subject') self.assertEqual(link.rule.pattern, '[tT]esting') self.assertEqual(link.action, LinkAction.jump) self.assertEqual(link.chain, config.chains['accept'])
def test_make_link(self): # Test that make_link() with no given chain creates a Link with a # deferred link action. link = make_link('Subject', '[tT]esting') self.assertEqual(link.rule.header, 'Subject') self.assertEqual(link.rule.pattern, '[tT]esting') self.assertEqual(link.action, LinkAction.defer) self.assertIsNone(link.chain)