Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Nov 29, 2024
1 parent 895cffe commit 8b06b2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def test_crawling():
testargs = ["", "--crawl", ""]
with patch.object(sys, "argv", testargs):
args = cli.parse_args(testargs)
cli.process_args(args)
cli.process_args(args)

testargs = ["", "--crawl", " "]
with patch.object(sys, "argv", testargs):
Expand Down
5 changes: 4 additions & 1 deletion tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,12 @@ def test_extraction_options():
# assert extract(my_html) is None

# readability
my_html = '<html><body><p>' + 'Text. '*10 + '</p></body></html>'
result = etree.tostring(try_readability(html.fromstring(my_html)))
assert len(result) > 10 and b'Text' in result
my_html = '<html><body><p>' + 'Text. '*10 + '<embed>Test</embed></p></body></html>'
result = etree.tostring(try_readability(html.fromstring(my_html)))
assert len(result) > 10 and 'Test' not in result
assert b'Test' not in result

my_html = '<html><head/><body>' + '<p>ABC def ghi jkl.</p>'*1000 + '<p>Posted on 1st Dec 2019<.</p></body></html>'
assert bare_extraction(my_html, config=ZERO_CONFIG, with_metadata=True).date is not None
Expand Down

0 comments on commit 8b06b2d

Please sign in to comment.