コード例 #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()]
コード例 #2
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()]