mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 11:06:32 +00:00
Skip GSD and size filtering without altitude
This commit is contained in:
@@ -118,6 +118,23 @@ def test_resolve_media_for_detect_override_wins():
|
||||
assert "paths" not in cfg
|
||||
|
||||
|
||||
def test_resolve_media_for_detect_omits_altitude_when_not_provided():
|
||||
# Arrange
|
||||
import main
|
||||
|
||||
tm = main.TokenManager(_access_jwt(), "")
|
||||
mock_ann = MagicMock()
|
||||
mock_ann.fetch_user_ai_settings.return_value = {"probabilityThreshold": 0.2}
|
||||
mock_ann.fetch_media_path.return_value = "/m/v.mp4"
|
||||
with patch("main.annotations_client", mock_ann):
|
||||
# Act
|
||||
cfg, path = main._resolve_media_for_detect("vid-2", tm, None)
|
||||
# Assert
|
||||
assert "altitude" not in cfg
|
||||
assert cfg["probability_threshold"] == 0.2
|
||||
assert path == "/m/v.mp4"
|
||||
|
||||
|
||||
def test_resolve_media_for_detect_raises_when_no_media_path():
|
||||
# Arrange
|
||||
import main
|
||||
|
||||
Reference in New Issue
Block a user