Skip to content

Commit

Permalink
update test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
codereverser committed Sep 19, 2023
1 parent 684f653 commit b578105
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion casparser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"CapitalGainsReport",
]

__version__ = "0.7.1"
__version__ = "0.7.2"
7 changes: 6 additions & 1 deletion casparser/parsers/pdfminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ def group_similar_rows(elements_list: List[Iterator[LTTextBoxHorizontal]]):
y0, y1 = sorted_elements[0].y0, sorted_elements[0].y1
items = []
for el in sorted_elements:
if len(items) > 0 and not (is_close(el.y1, y1, tol=3) or is_close(el.y0, y0, tol=3)):
if len(items) > 0 and not (
is_close(el.y1, y1, tol=3)
or is_close(el.y0, y0, tol=3)
or is_close(el.y1, y0, tol=2)
or is_close(el.y0, y1, tol=2)
):
line = "\t\t".join(
[x.get_text().strip() for x in sorted(items, key=lambda x: x.x0)]
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "--cov=casparser --cov-report=xml --cov-report=html"
addopts = "--cov=casparser --cov-report=xml --cov-report=html --exitfirst"
testpaths = [
"tests",
]
Expand Down
1 change: 1 addition & 0 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_output_json(self):
for scheme in folio.get("schemes", []):
assert scheme["isin"] is not None
assert scheme["amfi"] is not None
assert scheme["advisor"] not in (None, "ARN")
assert data.get("investor_info", {}).get("mobile") not in (None, "")
assert data["cas_type"] == CASFileType.DETAILED.value

Expand Down

0 comments on commit b578105

Please sign in to comment.