diff --git a/tests/unit/test_browse_scrape_links.py b/tests/unit/test_browse_scrape_links.py index 0a3340e7397a..031143353ee7 100644 --- a/tests/unit/test_browse_scrape_links.py +++ b/tests/unit/test_browse_scrape_links.py @@ -38,6 +38,7 @@ class TestScrapeLinks: + """Tests for the scrape_links function.""" # Tests that the function returns a list of formatted hyperlinks when # provided with a valid url that returns a webpage with hyperlinks. def test_valid_url_with_hyperlinks(self): @@ -49,6 +50,7 @@ def test_valid_url_with_hyperlinks(self): # Tests that the function returns correctly formatted hyperlinks when given a valid url. def test_valid_url(self, mocker): + """Test that the function returns correctly formatted hyperlinks when given a valid url.""" # Mock the requests.get() function to return a response with sample HTML containing hyperlinks mock_response = mocker.Mock() mock_response.status_code = 200 @@ -65,6 +67,7 @@ def test_valid_url(self, mocker): # Tests that the function returns "error" when given an invalid url. def test_invalid_url(self, mocker): + """Test that the function returns "error" when given an invalid url.""" # Mock the requests.get() function to return an HTTP error response mock_response = mocker.Mock() mock_response.status_code = 404 @@ -78,6 +81,7 @@ def test_invalid_url(self, mocker): # Tests that the function returns an empty list when the html contains no hyperlinks. def test_no_hyperlinks(self, mocker): + """Test that the function returns an empty list when the html contains no hyperlinks.""" # Mock the requests.get() function to return a response with sample HTML containing no hyperlinks mock_response = mocker.Mock() mock_response.status_code = 200 @@ -93,6 +97,7 @@ def test_no_hyperlinks(self, mocker): # Tests that scrape_links() correctly extracts and formats hyperlinks from # a sample HTML containing a few hyperlinks. def test_scrape_links_with_few_hyperlinks(self, mocker): + """Test that scrape_links() correctly extracts and formats hyperlinks from a sample HTML containing a few hyperlinks.""" # Mock the requests.get() function to return a response with a sample HTML containing hyperlinks mock_response = mocker.Mock() mock_response.status_code = 200