This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""Regression checks for the user-visible Korin Timer product name."""
|
||||
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class BrandingTests(unittest.TestCase):
|
||||
def test_desktop_entry_uses_korin_timer(self) -> None:
|
||||
desktop_entry = (ROOT / "packaging" / "korin-timer.desktop").read_text()
|
||||
|
||||
self.assertIn("Name=Korin Timer", desktop_entry)
|
||||
self.assertIn("Comment=2-step title switching timer for Elsword", desktop_entry)
|
||||
|
||||
def test_appimage_has_korin_timer_filename(self) -> None:
|
||||
build_script = (ROOT / "packaging" / "build-appimage.sh").read_text()
|
||||
|
||||
self.assertIn('OUT="${BUILD_DIR}/Korin-Timer.AppImage"', build_script)
|
||||
|
||||
def test_settings_titles_use_korin_timer(self) -> None:
|
||||
translations = (ROOT / "src" / "titletimer" / "i18n.py").read_text()
|
||||
|
||||
self.assertIn('"settings_title": {"de": "Korin Timer - Einstellungen",', translations)
|
||||
self.assertIn('"en": "Korin Timer - Settings"}', translations)
|
||||
|
||||
def test_gtk_application_ids_use_korin_timer(self) -> None:
|
||||
main_module = (ROOT / "src" / "titletimer" / "__main__.py").read_text()
|
||||
|
||||
self.assertIn('application_id="dev.korintimer.settings"', main_module)
|
||||
self.assertIn('application_id="dev.korintimer.overlay"', main_module)
|
||||
|
||||
def test_overlay_registers_the_cairo_foreign_converter(self) -> None:
|
||||
overlay_module = (ROOT / "src" / "titletimer" / "overlay.py").read_text()
|
||||
|
||||
self.assertIn('gi.require_foreign("cairo")', overlay_module)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Regression checks for the AppImage Gitea Actions workflow."""
|
||||
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
WORKFLOW = ROOT / ".gitea" / "workflows" / "build-appimage.yaml"
|
||||
|
||||
|
||||
class GiteaActionsWorkflowTests(unittest.TestCase):
|
||||
def test_build_workflow_creates_and_uploads_the_appimage(self) -> None:
|
||||
workflow = WORKFLOW.read_text()
|
||||
|
||||
self.assertIn("on:", workflow)
|
||||
self.assertIn("workflow_dispatch:", workflow)
|
||||
self.assertIn("runs-on: ubuntu-latest", workflow)
|
||||
self.assertIn("container: node:24-trixie", workflow)
|
||||
self.assertIn("python3-gi-cairo", workflow)
|
||||
self.assertIn("./packaging/build-appimage.sh", workflow)
|
||||
self.assertIn("actions/upload-artifact@v3", workflow)
|
||||
self.assertIn("path: build/Korin-Timer.AppImage", workflow)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user