-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add extract_url_to_string and extract_bytes_to_string tests
- Loading branch information
Showing
3 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
from extractous import Extractor | ||
from utils import read_to_string | ||
|
||
def test_extract_url(): | ||
def test_extract_url_to_stream(): | ||
extractor = Extractor() | ||
|
||
reader, metadata = extractor.extract_url("https://www.google.com") | ||
result = read_to_string(reader) | ||
|
||
assert "Google" in result | ||
assert len(metadata.keys()) > 0 | ||
|
||
def test_extract_url_to_string(): | ||
extractor = Extractor() | ||
|
||
content, metadata = extractor.extract_url_to_string("https://www.google.com") | ||
|
||
assert "Google" in content | ||
assert len(metadata.keys()) > 0 |