diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-10 15:26:45 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-10 15:26:45 +0200 |
| commit | 1521cc1ac0cca7ee8786056f84fa399d5cc268f9 (patch) | |
| tree | 00cc3132ee05894350db12e8e5cb94f81b1d4876 /packages/meshbay-hub/tests/test_photo_videos.py | |
| parent | 1fd7bbcd038cddf40540bae7083b9adf4c728912 (diff) | |
| download | meshbay-1521cc1ac0cca7ee8786056f84fa399d5cc268f9.tar.gz | |
feat(photos): show a phone's clips in their albums
Videos in a photo folder are thumbnailed by the node, counted and marked in
the album, and played in the group's video player from the lightbox; the
slideshow passes them by.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_photo_videos.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_photo_videos.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_photo_videos.py b/packages/meshbay-hub/tests/test_photo_videos.py new file mode 100644 index 0000000..2585f47 --- /dev/null +++ b/packages/meshbay-hub/tests/test_photo_videos.py @@ -0,0 +1,51 @@ +""" +A phone's clips among the photos of an album (harness/photo_video_probe.py). + +Backed up beside the photos (docs/MESHBAY_DESIGN.md §9.12), a clip belongs to +its album: counted on the card, marked and timed on its tile, and played in +the group's video player from the lightbox, never downloaded whole into it. A +slideshow is of photos and passes a clip by. +""" + +import json +import shutil +import subprocess +import sys +from pathlib import Path + +import pytest + +HARNESS = Path(__file__).parent / "harness" / "photo_video_probe.py" + + +@pytest.fixture(scope="module") +def cases(): + if shutil.which("google-chrome") is None: + pytest.skip("Chrome is not available") + proc = subprocess.run([sys.executable, str(HARNESS)], + capture_output=True, text=True, timeout=180) + assert proc.returncode == 0, f"probe failed: {proc.stdout}{proc.stderr}" + out = json.loads(proc.stdout) + assert "error" not in out, out["error"] + assert out["logs"] == [] + return {c["case"]: c for c in out["cases"]} + + +def test_the_album_counts_photos_and_videos_apart(cases): + assert "2 photos · 1 video" in cases["card"]["text"] + + +def test_a_clip_is_in_the_album_marked_with_its_length(cases): + assert cases["tiles"]["count"] == 3 + assert cases["tiles"]["badges"] == [None, "0:42", None] + + +def test_the_lightbox_hands_a_clip_to_the_video_player(cases): + c = cases["lightbox"] + assert c["title"] == "b.mp4" and c["play"] + assert c["played"] == ["v1"] + assert "0:42" in c["info"] + + +def test_a_slideshow_passes_a_clip_by(cases): + assert cases["slideshow"]["button"] and cases["slideshow"]["now"] == "c.jpg" |