def test_extended_1(self): snippets = ( Snippet(index='company', config=SearchConfig) .for_query("Me amore") .from_data("amore", "amore mia") ) self.assertEqual( snippets.lex(), "CALL SNIPPETS (('amore', 'amore mia'), 'company', 'Me amore')" )
def test_with_options(self): snippets = ( Snippet(index='company', config=SearchConfig) .for_query("Me amore") .from_data("amore mia") .options(before_match='<strong>', after_match='</strong>') ) self.assertEqual( snippets.lex(), ( "CALL SNIPPETS ('amore mia', 'company', 'Me amore', " "'<strong>' AS before_match, '</strong>' AS after_match)" ) )