forked from Github/frigate
Rewrite yaml loader (#13803)
* Ignore entire __pycache__ folder instead of individual *.pyc files * Rewrite the yaml loader to match PyYAML The old implementation would fail in weird ways with configs that were incorrect in just the right way. The new implementation just does what PyYAML would do, only diverging in case of duplicate keys. * Clarify duplicate yaml key ValueError message Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com> --------- Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
@@ -4,13 +4,14 @@ import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
import numpy as np
|
||||
import yaml
|
||||
from pydantic import ValidationError
|
||||
|
||||
from frigate.config import BirdseyeModeEnum, FrigateConfig
|
||||
from frigate.const import MODEL_CACHE_DIR
|
||||
from frigate.detectors import DetectorTypeEnum
|
||||
from frigate.plus import PlusApi
|
||||
from frigate.util.builtin import deep_merge, load_config_with_no_duplicates
|
||||
from frigate.util.builtin import NoDuplicateKeysLoader, deep_merge
|
||||
|
||||
|
||||
class TestConfig(unittest.TestCase):
|
||||
@@ -1537,7 +1538,7 @@ class TestConfig(unittest.TestCase):
|
||||
"""
|
||||
|
||||
self.assertRaises(
|
||||
ValueError, lambda: load_config_with_no_duplicates(raw_config)
|
||||
ValueError, lambda: yaml.load(raw_config, NoDuplicateKeysLoader)
|
||||
)
|
||||
|
||||
def test_object_filter_ratios_work(self):
|
||||
|
||||
Reference in New Issue
Block a user