def test_store_and_access(self): s = State() p = PredicateInstance('happy', Instance('a')) s.append(p) self.assertEqual([p], s.fetch('happy', [Instance('a')])) self.assertStateContains(PredicateInstance('happy', Instance('a')), Evaluator(state=s))
def test_store_multiple(self): s = State() s.append(PredicateInstance('happy', Instance('a'))) s.append(PredicateInstance('unhappy', Instance('a'))) self.assertStateContains(PredicateInstance('happy', Instance('a')), Evaluator(state=s)) self.assertStateContains(PredicateInstance('unhappy', Instance('a')), Evaluator(state=s))