Fix tests

This commit is contained in:
Nicolas Mowen 2024-05-04 08:49:50 -06:00
parent 621d506198
commit 2d5541d895
2 changed files with 3 additions and 8 deletions

View File

@ -1511,10 +1511,10 @@ class FrigateConfig(FrigateBaseModel):
) )
detector_config: DetectorConfig = adapter.validate_python(model_dict) detector_config: DetectorConfig = adapter.validate_python(model_dict)
if detector_config.model is None: if detector_config.model is None:
detector_config.model = config.model detector_config.model = config.model.model_copy()
else: else:
path = detector_config.model.path path = detector_config.model.path
detector_config.model = config.model detector_config.model = config.model.model_copy()
detector_config.model.path = path detector_config.model.path = path
if "path" not in model_dict or len(model_dict.keys()) > 1: if "path" not in model_dict or len(model_dict.keys()) > 1:

View File

@ -82,7 +82,7 @@ class TestConfig(unittest.TestCase):
}, },
"edgetpu": { "edgetpu": {
"type": "edgetpu", "type": "edgetpu",
"model": {"path": "/edgetpu_model.tflite", "width": 160}, "model": {"path": "/edgetpu_model.tflite"},
}, },
"openvino": { "openvino": {
"type": "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["edgetpu"].model.path == "/edgetpu_model.tflite"
assert runtime_config.detectors["openvino"].model.path == "/etc/hosts" 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): def test_invalid_mqtt_config(self):
config = { config = {
"mqtt": {"host": "mqtt", "user": "test"}, "mqtt": {"host": "mqtt", "user": "test"},