Removing duplicate tests browse_tests (#3535)

Co-authored-by: Nicholas Tindle <nick@ntindle.com>
This commit is contained in:
Media
2023-04-29 19:16:16 +02:00
committed by GitHub
parent f77c3604ce
commit 095883ca54

View File

@@ -1,29 +0,0 @@
import os
import sys
import unittest
from bs4 import BeautifulSoup
sys.path.append(os.path.abspath("../scripts"))
from browse import extract_hyperlinks
class TestBrowseLinks(unittest.TestCase):
"""Unit tests for the browse module functions that extract hyperlinks."""
def test_extract_hyperlinks(self):
"""Test the extract_hyperlinks function with a simple HTML body."""
body = """
<body>
<a href="https://google.com">Google</a>
<a href="foo.html">Foo</a>
<div>Some other crap</div>
</body>
"""
soup = BeautifulSoup(body, "html.parser")
links = extract_hyperlinks(soup, "http://example.com")
self.assertEqual(
links,
[("Google", "https://google.com"), ("Foo", "http://example.com/foo.html")],
)