def test_errors_in_evaluator_statements(self, eq, context, error_type): with self.assertRaises(error_type): eval_statements(eq, context) expression = ExpressionFactory.from_spec({ "type": "evaluator", "statement": eq, "context_variables": context }) self.assertEqual(expression({}), None)
def test_unsupported_evaluator_statements(self, eq, context): with self.assertRaises(InvalidExpression): eval_statements(eq, context) expression = ExpressionFactory.from_spec({ "type": "evaluator", "statement": eq, "context_variables": context }) self.assertEqual(expression({}), None)
def test_supported_evaluator_statements(self, eq, context, expected_value): self.assertEqual(eval_statements(eq, context), expected_value)