def test_match_context_depth(self): context = MatchContext() self.assertFalse(context.matched()) template = PatternTemplateNode(template=TemplateNode) context.set_template(template) self.assertEquals(template, context.template_node()) self.assertTrue(context.matched())
def test_match_context_depth(self): context = MatchContext(max_search_depth=100, max_search_timeout=60) self.assertEquals(100, context.max_search_depth) self.assertEquals(60, context.max_search_timeout) self.assertFalse(context.matched()) template = PatternTemplateNode(template=TemplateNode) context.set_template(template) self.assertEquals(template, context.template_node()) self.assertTrue(context.matched())
def test_match_context_depth(self): context = MatchContext(max_search_depth=100, max_search_timeout=60, tokenizer=self._client_context.brain.tokenizer) self.assertEqual(100, context.max_search_depth) self.assertEqual(60, context.max_search_timeout) self.assertFalse(context.matched()) template = PatternTemplateNode(template=TemplateNode) context.set_template(template) self.assertEqual(template, context.template_node()) self.assertTrue(context.matched())
def test_match_context_depth(self): context = MatchContext(max_search_depth=100, max_search_timeout=60, tokenizer=self._bot.brain.tokenizer) self.assertEquals(100, context.max_search_depth) self.assertEquals(60, context.max_search_timeout) self.assertFalse(context.matched()) template = PatternTemplateNode(template=TemplateNode) context.set_template(template) self.assertEquals(template, context.template_node()) self.assertTrue(context.matched())