mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Add test for arg as string with space
This commit is contained in:
parent
df2e5e728b
commit
1799a4fb75
@ -60,6 +60,9 @@
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnType": true,
|
||||
"python.testing.pytestEnabled": false,
|
||||
"python.testing.unittestEnabled": true,
|
||||
"python.testing.unittestArgs": ["-v", "-s", "./frigate/test"],
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"eslint.workingDirectories": ["./web"],
|
||||
"[json][jsonc]": {
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,7 +2,7 @@
|
||||
*.pyc
|
||||
*.swp
|
||||
debug
|
||||
.vscode/**
|
||||
.vscode/*
|
||||
!.vscode/launch.json
|
||||
config/config.yml
|
||||
models
|
||||
|
||||
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@ -1,7 +1,8 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: Frigate",
|
||||
"name": "Python: Launch Frigate",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "frigate",
|
||||
|
||||
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ build: version amd64 arm64 armv7
|
||||
push: build
|
||||
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag $(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH) .
|
||||
|
||||
run_tests: frigate
|
||||
run_tests: local
|
||||
docker run --rm --entrypoint=python3 frigate:latest -u -m unittest
|
||||
docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.config import FFMPEG_INPUT_ARGS_DEFAULT, FrigateConfig
|
||||
from frigate.ffmpeg_presets import parse_preset_input
|
||||
|
||||
|
||||
@ -93,6 +93,16 @@ class TestFfmpegPresets(unittest.TestCase):
|
||||
" ".join(frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"])
|
||||
)
|
||||
|
||||
def test_ffmpeg_input_args_as_string(self):
|
||||
argsString = " ".join(FFMPEG_INPUT_ARGS_DEFAULT) + ' -some "arg with space"'
|
||||
argsList = FFMPEG_INPUT_ARGS_DEFAULT + ["-some", "arg with space"]
|
||||
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = argsString
|
||||
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
||||
frigate_config.cameras["back"].create_ffmpeg_cmds()
|
||||
assert set(argsList).issubset(
|
||||
frigate_config.cameras["back"].ffmpeg_cmds[0]["cmd"]
|
||||
)
|
||||
|
||||
def test_ffmpeg_input_not_preset(self):
|
||||
self.default_ffmpeg["cameras"]["back"]["ffmpeg"]["input_args"] = "-some inputs"
|
||||
frigate_config = FrigateConfig(**self.default_ffmpeg)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user