Esempio n. 1
0
 def test__parse_aux_exception(self):
     # TODO more exception tests
     in_list = [
         ['some', '(', 'A', ',', ' ', ',', 'and', '(', 'b', ',', 'a', '(', 'c', ')', ')', ')']
     ]
     for in_test in in_list:
         assert_raises(FOL._parse_aux(in_test, []))
Esempio n. 2
0
 def test__parse_aux(self):
     in_list = [['and', '(', 'A', ',', 'B', ')'],
                ['or', '(', 'A', ',', 'and', '(', 'B', ',', 'C', ')', ')'],
                ['some', '(', 'A', ',', 'all', '(', 'B', ',', 'and', '(', 'b', ',', 'a', '(', 'c', ')', ')', ')',
                 ')'],
                []]
     out_list = [['and', ['A'], ['B']],
                 ['or', ['A'], ['and', ['B'], ['C']]],
                 ['some', ['A'], ['all', ['B'], ['and', ['b'], ['a', ['c']]]]],
                 None]
     fol = FOL()
     for in_test, out_test in zip(in_list, out_list):
         output = fol._parse_aux(in_test, [])
         assert output == out_test, (output, out_test)