code: def test_web_search_top_k(
      self, mock_serper_dev_search_result, top_k: int
  ):
      ws = SerperDevWebSearch(api_key="some_invalid_key", top_k=top_k)
      results = ws.run(query="Who is the boyfriend of Olivia Wilde?")
      documents = results["documents"]
      links = results["links"]
      assert len(documents) == len(links) == top_k
      assert all(isinstance(doc, Document) for doc in documents)
      assert all(isinstance(link, str) for link in links)
      assert all(link.startswith("http") for link in links)
  
file_path: haystack/test/components/websearch/test_serperdev.py
imports: import os
  from unittest.mock import Mock, patch
  import pytest
  from requests import Timeout, RequestException, HTTPError
  from haystack import Document
  from haystack.components.websearch.serper_dev import SerperDevWebSearch, SerperDevError
label_desc: Use image node_id 3 for calling the TestSerperDevSearchAPI obj's underlying member method code with example usage: obj.test_web_search_top_k(mock_serper_dev_search_result, top_k) without return types