MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / get_absolute_path

Function get_absolute_path

tests/test_video_stream.py:59–76  ·  view source on GitHub ↗

Returns the absolute path to a (relative) path of a file that should exist within the tests/ directory. Throws FileNotFoundError if the file could not be found.

(relative_path: str)

Source from the content-addressed store, hash-verified

57
58# TODO: Reduce code duplication here and in `conftest.py`
59def get_absolute_path(relative_path: str) -> str:
60 """Returns the absolute path to a (relative) path of a file that
61 should exist within the tests/ directory.
62
63 Throws FileNotFoundError if the file could not be found.
64 """
65 abs_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), relative_path)
66 if not os.path.exists(abs_path):
67 raise FileNotFoundError(
68 f"""
69Test video file ({relative_path}) must be present to run test case. This file can be obtained by running the following commands from the root of the repository:
70
71git fetch --depth=1 https://github.com/Breakthrough/PySceneDetect.git refs/heads/resources:refs/remotes/origin/resources
72git checkout refs/remotes/origin/resources -- tests/resources/
73git reset
74"""
75 )
76 return abs_path
77
78
79@dataclass

Callers 2

get_test_video_paramsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected