fix test sample s1.mp4 missing
This commit is contained in:
@@ -193,11 +193,11 @@ print(json.dumps({
|
||||
|
||||
# Default runtime-verification inputs. Overridable by CLI flags or environment.
|
||||
DEFAULT_RUNTIME_CONFIG = os.getenv("ORISYS_VERIFY_CONFIG", "box")
|
||||
# Clips tracked in the repository, smallest first.
|
||||
# Clips tracked in the repository. ``data/sample/s1.mp4`` is the sanctioned
|
||||
# verification input; the larger 720p clip is deliberately not listed, so a
|
||||
# missing s1.mp4 fails loudly instead of silently verifying against it.
|
||||
DEFAULT_VIDEO_CANDIDATES = (
|
||||
Path("data") / "sample" / "s1.mp4",
|
||||
Path("data") / "sample" / "s1_720p.mp4",
|
||||
Path("tests") / "idle_1min.mp4",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
+12
-2
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from contextlib import ExitStack
|
||||
@@ -21,9 +22,17 @@ def _resource_path(*parts: str) -> Path | None:
|
||||
"""Resolve a package resource to a filesystem path for wheel-safe loaders."""
|
||||
try:
|
||||
resource = files("orisys").joinpath(*parts)
|
||||
return _RESOURCE_STACK.enter_context(as_file(resource))
|
||||
resolved = _RESOURCE_STACK.enter_context(as_file(resource))
|
||||
except Exception:
|
||||
return None
|
||||
# ``as_file`` is not contractually a ``pathlib.Path``: a Nuitka-compiled
|
||||
# build hands back its own ``nuitka_resource_reader_files``, which is
|
||||
# path-like but has no ``.resolve()``. Normalise here so every caller can
|
||||
# treat the result as a Path.
|
||||
try:
|
||||
return Path(os.fspath(resolved))
|
||||
except TypeError:
|
||||
return None
|
||||
|
||||
|
||||
def _unique_paths(paths) -> list[Path]:
|
||||
@@ -31,9 +40,10 @@ def _unique_paths(paths) -> list[Path]:
|
||||
unique: list[Path] = []
|
||||
seen: set[str] = set()
|
||||
for path in paths:
|
||||
path = Path(path) if not isinstance(path, Path) else path
|
||||
try:
|
||||
key = str(path.resolve()).casefold()
|
||||
except OSError: # pragma: no cover - defensive: unresolvable path
|
||||
except (OSError, ValueError): # pragma: no cover - defensive
|
||||
key = str(path).casefold()
|
||||
if key in seen:
|
||||
continue
|
||||
|
||||
+3
-2
@@ -46,11 +46,12 @@ from orisys import Sensor
|
||||
from orisys import configs as orisys_configs
|
||||
from orisys.backend_availability import check_cupy_available, check_opencl_available
|
||||
|
||||
# Video clips that are tracked in git, in preference order.
|
||||
# Video clips that are tracked in git, in preference order. The 720p clip is
|
||||
# deliberately not a fallback: tests should run the sanctioned sample or skip,
|
||||
# never silently verify against a different resolution.
|
||||
DEFAULT_VIDEO_CANDIDATES = (
|
||||
Path("tests") / "idle_1min.mp4",
|
||||
Path("data") / "sample" / "s1.mp4",
|
||||
Path("data") / "sample" / "s1_720p.mp4",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user