Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed May 4, 2024
1 parent 621d506 commit 2d5541d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions frigate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,10 +1511,10 @@ def runtime_config(self, plus_api: PlusApi = None) -> FrigateConfig:
)
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:
Expand Down
7 changes: 1 addition & 6 deletions frigate/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_detector_custom_model_path(self, mock_labels):
},
"edgetpu": {
"type": "edgetpu",
"model": {"path": "/edgetpu_model.tflite", "width": 160},
"model": {"path": "/edgetpu_model.tflite"},
},
"openvino": {
"type": "openvino",
Expand Down Expand Up @@ -112,11 +112,6 @@ def test_detector_custom_model_path(self, mock_labels):
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"},
Expand Down

0 comments on commit 2d5541d

Please sign in to comment.