Example #1
0
    def evaluator(self, mocker):
        context = {'x': 1, 'y': 2, 'z': 3}

        interpreter = mocker.MagicMock(name='Interpreter')
        interpreter.time = 0
        interpreter.queue = mocker.MagicMock(return_value=None)
        interpreter.statechart = mocker.MagicMock()
        interpreter.configuration = []

        return code.PythonEvaluator(interpreter, initial_context=context)
Example #2
0
    def setUp(self):
        context = {'x': 1, 'y': 2, 'z': 3}

        interpreter = MagicMock(name='Interpreter')
        interpreter.time = 0
        interpreter.queue = MagicMock(return_value=None)
        interpreter.statechart = MagicMock()
        interpreter.configuration = []

        self.evaluator = code.PythonEvaluator(interpreter,
                                              initial_context=context)
        self.interpreter = interpreter