-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #369 from VikParuchuri/vik_v2
Reorganize tests
- Loading branch information
Showing
12 changed files
with
46 additions
and
17 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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from marker.v2.renderers.markdown import MarkdownRenderer | ||
|
||
|
||
@pytest.mark.config({"page_range": [0]}) | ||
def test_markdown_renderer(pdf_document): | ||
renderer = MarkdownRenderer() | ||
md = renderer(pdf_document).markdown | ||
|
||
# Verify markdown | ||
assert '# Subspace Adversarial Training' in md | ||
|
||
|
||
@pytest.mark.config({"page_range": [0, 1], "paginate_output": True}) | ||
def test_markdown_renderer_pagination(pdf_document): | ||
renderer = MarkdownRenderer({"paginate_output": True}) | ||
md = renderer(pdf_document).markdown | ||
|
||
assert "{0}-" in md | ||
assert "{1}-" in md |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
from marker.v2.builders.structure import StructureBuilder | ||
from marker.v2.schema import BlockTypes | ||
|
||
|
||
@pytest.mark.config({"page_range": [4]}) | ||
def test_list_grouping(pdf_document): | ||
structure = StructureBuilder() | ||
structure(pdf_document) | ||
|
||
page = pdf_document.pags[0] | ||
list_groups = [] | ||
for block in page.children: | ||
if block.block_type == BlockTypes.ListGroup: | ||
list_groups.append(block) | ||
|
||
assert len(list_groups) == 1 | ||
|
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