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.
(path: ty.AnyStr)
| 44 | |
| 45 | |
| 46 | def check_exists(path: ty.AnyStr) -> ty.AnyStr: |
| 47 | """Returns the absolute path to a (relative) path of a file that |
| 48 | should exist within the tests/ directory. |
| 49 | |
| 50 | Throws FileNotFoundError if the file could not be found. |
| 51 | """ |
| 52 | if not os.path.exists(path): |
| 53 | raise FileNotFoundError( |
| 54 | f""" |
| 55 | Test video file ({path}) must be present to run test case. This file can be obtained by running the following commands from the root of the repository: |
| 56 | |
| 57 | git fetch --depth=1 https://github.com/Breakthrough/PySceneDetect.git refs/heads/resources:refs/remotes/origin/resources |
| 58 | git checkout refs/remotes/origin/resources -- tests/resources/ |
| 59 | git reset |
| 60 | """ |
| 61 | ) |
| 62 | return path |
| 63 | |
| 64 | |
| 65 | # |
no outgoing calls
no test coverage detected