Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions contrib/web/test_debian_package_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# File: contrib/web/test_debian_package_docs.py

from __future__ import annotations

import unittest
from pathlib import Path


class DebianPackageDocumentationTest(unittest.TestCase):
def test_native_website_initialization_creates_site_json(self) -> None:
repository = Path(__file__).resolve().parents[2]
readme = (repository / "debian" / "README.Debian").read_text(
encoding="utf-8"
)
install_manifest = (
repository / "debian" / "activity-relay.install"
).read_text(encoding="utf-8")

self.assertIn(
"contrib/web/site.json.example etc/activity-relay-web",
install_manifest,
)

rebuild_wrapper = (
repository / "contrib" / "web" / "activity-relay-rebuild-site"
).read_text(encoding="utf-8")

copy_sequence = (
" cp -an /usr/share/activity-relay/web/. "
"/etc/activity-relay-web/\n"
"\n"
" cp --update=none \\\n"
" /etc/activity-relay-web/site.json.example \\\n"
" /etc/activity-relay-web/site.json\n"
)

self.assertEqual(readme.count(copy_sequence), 1)
self.assertIn(
'config_file="${ACTIVITY_RELAY_WEB_CONFIG:-'
'/etc/activity-relay-web/site.json}"',
rebuild_wrapper,
)
self.assertLess(
readme.index(copy_sequence),
readme.index(
"Edit /etc/activity-relay-web/site.json and build the site"
),
)


if __name__ == "__main__":
unittest.main()

# EOF: contrib/web/test_debian_package_docs.py
4 changes: 4 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ an editable copy without replacing existing files:

cp -an /usr/share/activity-relay/web/. /etc/activity-relay-web/

cp --update=none \
/etc/activity-relay-web/site.json.example \
/etc/activity-relay-web/site.json

Edit /etc/activity-relay-web/site.json and build the site with the current
package-managed source:

Expand Down