Exemple #1
0
 def test_english_highlighted_noop(self):
     phrases = [ Phrase('phrase type', { 'english' : 'foo' }, []),
                 Phrase('phrase type', { 'english' : 'bar' }, []),
                 Phrase('phrase type', { 'english' : 'baz' }, []) ]
     query = Query('the_table', phrases)
     query.set_base_atoms([Atom('atom type', 'ba')])
     self.assertEqual(query.get_english_highlighted(), 'Foo bar baz?')
Exemple #2
0
 def test_set_base_atoms_twice(self):
     query = Query('the_table', [ Phrase('phrase type', { 'english' : 'foo' }, []) ])
     query.set_base_atoms([Atom('atom type', 'ba')])
     with self.assertRaises(Exception):
         query.set_base_atoms([Atom('atom type', 'ba')])