Skip to content

Commit 6c89cc7

Browse files
fix: formatting.
1 parent 8f01fa1 commit 6c89cc7

5 files changed

+12
-5
lines changed

tests/test_annotation_engine.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
def test_get_annotation():
1212
"""Test get_anntation from the Inscriptis class"""
1313
html = "<b>Chur</b> is a City in <b>Switzerland</b>"
14-
rules = {'b': ['bold']}
14+
rules = {"b": ["bold"]}
1515

1616
inscriptis = Inscriptis(fromstring(html), ParserConfig(annotation_rules=rules))
1717

1818
assert inscriptis.get_text() == "Chur is a City in Switzerland"
19-
assert inscriptis.get_annotations() == [Annotation(start=0, end=4, metadata='bold'), Annotation(start=18, end=29, metadata='bold')]
19+
assert inscriptis.get_annotations() == [
20+
Annotation(start=0, end=4, metadata="bold"),
21+
Annotation(start=18, end=29, metadata="bold"),
22+
]

tests/test_annotation_output_processor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def test_html_annotator():
6060
processor = HtmlExtractor()
6161
result = processor(EXAMPLE_OUTPUT)
6262

63-
6463
assert result.startswith("<html><head><style>")
65-
assert result.split("</style>")[1] == ("</head>"
64+
assert result.split("</style>")[1] == (
65+
"</head>"
6666
'<body><pre><span class="heading-label">heading'
6767
'</span><span class="heading">'
6868
'<span class="h1-label">h1</span><span class="h1">'
@@ -72,7 +72,8 @@ def test_html_annotator():
7272
'<span class="emphasis">Chur</span> is the capital '
7373
"and largest town of the Swiss canton of the "
7474
"Grisons and lies in the Grisonian Rhine Valley."
75-
"</pre></body></html>")
75+
"</pre></body></html>"
76+
)
7677

7778

7879
def test_trailing_tag_annotation():

tests/test_block.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test cases for the Block class.
33
"""
4+
45
from inscriptis.model.canvas.block import Block
56
from inscriptis.model.canvas.prefix import Prefix
67

tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests the Inscriptis CLI client.
33
"""
4+
45
from io import StringIO
56
from pathlib import Path
67
from json import loads

tests/test_custom_html_tag_handling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the custom HTML tag handling."""
2+
23
from lxml.html import fromstring
34

45
from inscriptis import Inscriptis, ParserConfig

0 commit comments

Comments
 (0)