Merge pull request #285 from venthur/atom-utf8

Fixed atom feed encoding to utf-8
This commit is contained in:
Bastian Venthur
2025-04-24 14:06:18 +02:00
committed by GitHub
3 changed files with 11 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
## [unreleased]
* Fixed Atom feed encoding to 'utf-8'
* Added Python 3.13 to github actions
* `requirements*.txt` files are handled by pip-tools. Updates are handled by
make update-requirements based on the dependencies described in the

View File

@@ -396,7 +396,7 @@ def generate_feed(
)
with open(f"{output_dir}/atom.xml", "w") as fh:
feed.write(fh, encoding="utf8")
feed.write(fh, encoding='utf-8')
def generate_index(

View File

@@ -99,6 +99,15 @@ def test_generate_feed_with_description(cleandir: str) -> None:
assert '<content type="html">content' in feed
def test_feed_is_unicode(cleandir: str) -> None:
"""Test generate_feed."""
articles: list[tuple[str, dict[str, Any]]] = []
blag.generate_feed(articles, "build", " ", " ", " ", " ")
with open("build/atom.xml") as fh:
feed = fh.read()
assert 'encoding="utf-8"' in feed
def test_parse_args_build() -> None:
"""Test parse_args with build."""
# test default args