1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00

Fixed atom feed encoding to utf-8

This commit is contained in:
Bastian Venthur
2025-04-24 14:03:47 +02:00
parent 05af204254
commit b0139dad8d
3 changed files with 11 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
## [unreleased] ## [unreleased]
* Fixed Atom feed encoding to 'utf-8'
* Added Python 3.13 to github actions * Added Python 3.13 to github actions
* `requirements*.txt` files are handled by pip-tools. Updates are handled by * `requirements*.txt` files are handled by pip-tools. Updates are handled by
make update-requirements based on the dependencies described in the 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: with open(f"{output_dir}/atom.xml", "w") as fh:
feed.write(fh, encoding="utf8") feed.write(fh, encoding='utf-8')
def generate_index( 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 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: def test_parse_args_build() -> None:
"""Test parse_args with build.""" """Test parse_args with build."""
# test default args # test default args