コード例 #1
0
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)
コード例 #2
0
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)
コード例 #3
0
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)
コード例 #4
0
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)
コード例 #5
0
def test_supported_evaluator_statements(self, eq, context, expected_value):
    self.assertEqual(eval_statements(eq, context), expected_value)
コード例 #6
0
def test_supported_evaluator_statements(self, eq, context, expected_value):
    self.assertEqual(eval_statements(eq, context), expected_value)