def METHOD_NAME(mocker):
    base_path = "foo"
    target_path = os.path.join(base_path, "bar")
    def base_path_is_symlink(path):
        if path == base_path:
            return True
        return False
    mocker.patch.object(
        system,
        "is_symlink",
        return_value=True,
        side_effect=base_path_is_symlink,
    )
    assert not contains_symlink_up_to(target_path, base_path)