mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
Fix tests
This commit is contained in:
parent
621d506198
commit
2d5541d895
@ -1511,10 +1511,10 @@ class FrigateConfig(FrigateBaseModel):
|
||||
)
|
||||
detector_config: DetectorConfig = adapter.validate_python(model_dict)
|
||||
if detector_config.model is None:
|
||||
detector_config.model = config.model
|
||||
detector_config.model = config.model.model_copy()
|
||||
else:
|
||||
path = detector_config.model.path
|
||||
detector_config.model = config.model
|
||||
detector_config.model = config.model.model_copy()
|
||||
detector_config.model.path = path
|
||||
|
||||
if "path" not in model_dict or len(model_dict.keys()) > 1:
|
||||
|
||||
@ -82,7 +82,7 @@ class TestConfig(unittest.TestCase):
|
||||
},
|
||||
"edgetpu": {
|
||||
"type": "edgetpu",
|
||||
"model": {"path": "/edgetpu_model.tflite", "width": 160},
|
||||
"model": {"path": "/edgetpu_model.tflite"},
|
||||
},
|
||||
"openvino": {
|
||||
"type": "openvino",
|
||||
@ -112,11 +112,6 @@ class TestConfig(unittest.TestCase):
|
||||
assert runtime_config.detectors["edgetpu"].model.path == "/edgetpu_model.tflite"
|
||||
assert runtime_config.detectors["openvino"].model.path == "/etc/hosts"
|
||||
|
||||
assert runtime_config.model.width == 512
|
||||
assert runtime_config.detectors["cpu"].model.width == 320
|
||||
assert runtime_config.detectors["edgetpu"].model.width == 160
|
||||
assert runtime_config.detectors["openvino"].model.width == 512
|
||||
|
||||
def test_invalid_mqtt_config(self):
|
||||
config = {
|
||||
"mqtt": {"host": "mqtt", "user": "test"},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user