forked from Breakthrough/PySceneDetect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_platform.py
More file actions
40 lines (33 loc) · 1.36 KB
/
Copy pathtest_platform.py
File metadata and controls
40 lines (33 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
#
# PySceneDetect: Python-Based Video Scene Detector
# -------------------------------------------------------------------
# [ Site: https://scenedetect.com ]
# [ Docs: https://scenedetect.com/docs/ ]
# [ Github: https://github.com/Breakthrough/PySceneDetect/ ]
#
# Copyright (C) 2014-2024 Brandon Castellano <http://www.bcastell.com>.
# PySceneDetect is licensed under the BSD 3-Clause License; see the
# included LICENSE file, or visit one of the above pages for details.
#
""" PySceneDetect scenedetect.platform Tests
This file includes unit tests for the scenedetect.platform module, containing
all platform/library/OS-specific compatibility fixes.
"""
import platform
import pytest
from scenedetect.platform import CommandTooLong, invoke_command
def test_invoke_command():
""" Ensures the function exists and is callable without throwing
an exception. """
if platform.system() == 'Windows':
invoke_command(['cmd'])
else:
invoke_command(['echo'])
def test_long_command():
""" [Windows Only] Ensures that a command string too large to be handled
is translated to the correct exception for error handling.
"""
if platform.system() == 'Windows':
with pytest.raises(CommandTooLong):
invoke_command('x' * 2**15)