Beispiel #1
0
def test_objects_arguments(patch, tree):
    patch.object(Objects, 'argument')
    tree.find_data.return_value = ['argument']
    result = Objects.arguments(tree)
    tree.find_data.assert_called_with('arguments')
    Objects.argument.assert_called_with('argument')
    assert result == [Objects.argument()]
Beispiel #2
0
def test_objects_argument(patch, tree):
    patch.object(Objects, 'expression')
    result = Objects.argument(tree)
    assert tree.child.call_count == 2
    Objects.expression.assert_called_with(tree.child())
    expected = {'$OBJECT': 'argument', 'name': tree.child().value,
                'argument': Objects.expression()}
    assert result == expected