Skip to content

Commit

Permalink
fix typo in variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
rprimet committed Jun 19, 2024
1 parent 06d1ead commit a1d32d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/catleg/skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def markdown_skeleton(textid: str, sectionid: str) -> str:
# If it is not a section, then it is an article
parts.append(f"{'#' * (level + 1)} Article {node['num']} | {node['id']}")
article = await back.article(node["id"])
parts.append(_formatted_atricle(article))
parts.append(_formatted_article(article))
else:
parts.append(f"{'#' * level} {node['title']}")

Expand Down Expand Up @@ -82,7 +82,7 @@ def _article_skeleton(raw_article_json, breadcrumbs: bool = True):
# level: code (1) + length of section hierarchy + article (1)
level = 1 + len(article_json["context"]["titresTM"]) + 1
parts.append(f"{'#' * level} Article {article_json['num']} | {article.id}")
parts.append(_formatted_atricle(article))
parts.append(_formatted_article(article))
return "\n\n".join(parts)


Expand All @@ -95,5 +95,5 @@ def _preorder(node, level=1):
yield from _preorder(section, level + 1)


def _formatted_atricle(article):
def _formatted_article(article):
return mdformat.text(article.to_markdown(), options={"wrap": 80, "number": True})
4 changes: 2 additions & 2 deletions tests/test_skeleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from catleg.parse_catala_markdown import parse_catala_file
from catleg.query import _article_from_legifrance_reply
from catleg.skeleton import _article_skeleton, _formatted_atricle
from catleg.skeleton import _article_skeleton, _formatted_article

from .test_legifrance_queries import _json_from_test_file

Expand All @@ -13,7 +13,7 @@
def test_no_article_renumbering():
article_json = _json_from_test_file("LEGIARTI000044983201.json")
article = _article_from_legifrance_reply(article_json)
formatted_article_md = _formatted_atricle(article)
formatted_article_md = _formatted_article(article)
assert "1. Le bénéfice ou revenu imposable est constitué" in formatted_article_md
assert "2. Le revenu global net annuel" in formatted_article_md
assert (
Expand Down

0 comments on commit a1d32d8

Please sign in to comment.