Using template0 when creating map db to avoid utf8 bug.
Some checks failed
CodeQL / Analyze (push) Has been cancelled

Fixed test_new_archive to handle platform-specific HTML formatting from BeautifulSoup.
Bumped version to 0.16.1-beta.
This commit is contained in:
Roland 2025-11-18 16:31:03 -07:00
parent 9b21d38221
commit 41e1ed6be6
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
3 changed files with 15 additions and 4 deletions

View file

@ -294,8 +294,19 @@ async def test_new_archive(test_session, test_directory, fake_now):
assert archive1.domain is not None
# The actual files were dumped and read correctly. The HTML/JSON files are reformatted.
assert archive1.singlefile_path.read_text().count('\n') >= 10
assert archive1.readability_path.read_text().count('\n') >= 5
# Note: We check for content presence rather than exact formatting because BeautifulSoup's
# prettify() can produce different output on different platforms (Mac vs CI).
singlefile_text = archive1.singlefile_path.read_text()
assert 'Page saved with SingleFile' in singlefile_text
assert 'test single-file' in singlefile_text
assert 'ジにてこちら' in singlefile_text
assert '<title>' in singlefile_text
assert 'some title' in singlefile_text
assert singlefile_text.count('\n') >= 5 # Verify it's properly formatted with newlines
readability_text = archive1.readability_path.read_text()
assert 'test readability content' in readability_text
assert readability_text.count('\n') >= 3 # Verify it's properly formatted with newlines
with open(archive1.readability_txt_path) as fh:
assert fh.read() == 'test readability textContent'
assert archive1.readability_json_path.read_text() == '''{

View file

@ -19,7 +19,7 @@ pg_createcluster 15 map --port=5433 --start -e utf8
sudo -iu postgres psql -c '\l' --port=5433 | grep gis || (
sudo -iu postgres createuser --port=5433 _renderd
sudo -iu postgres psql --port=5433 -c "alter user _renderd password 'wrolpi'"
sudo -iu postgres createdb --port=5433 -E UTF8 -O _renderd gis
sudo -iu postgres createdb --port=5433 -E UTF8 -O _renderd --template=template0 gis
sudo -iu postgres psql -d gis --port=5433 -c 'CREATE EXTENSION postgis'
sudo -iu postgres psql -d gis --port=5433 -c 'CREATE EXTENSION hstore'
echo "Created gis database"

View file

@ -1 +1 @@
0.16.0-beta
0.16.1-beta