mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 13:15:25 +03:00
Fix test
This commit is contained in:
parent
64ecfcf6c0
commit
6a412f5103
@ -6,20 +6,28 @@ from frigate.record.maintainer import SegmentInfo
|
|||||||
|
|
||||||
class TestRecordRetention(unittest.TestCase):
|
class TestRecordRetention(unittest.TestCase):
|
||||||
def test_motion_should_keep_motion_not_object(self):
|
def test_motion_should_keep_motion_not_object(self):
|
||||||
segment_info = SegmentInfo(motion_area=1, active_object_count=0, average_dBFS=0)
|
segment_info = SegmentInfo(
|
||||||
|
motion_area=1, active_object_count=0, region_count=0, average_dBFS=0
|
||||||
|
)
|
||||||
assert not segment_info.should_discard_segment(RetainModeEnum.motion)
|
assert not segment_info.should_discard_segment(RetainModeEnum.motion)
|
||||||
assert segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
assert segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
||||||
|
|
||||||
def test_object_should_keep_object_not_motion(self):
|
def test_object_should_keep_object_not_motion(self):
|
||||||
segment_info = SegmentInfo(motion_area=0, active_object_count=1, average_dBFS=0)
|
segment_info = SegmentInfo(
|
||||||
|
motion_area=0, active_object_count=1, region_count=0, average_dBFS=0
|
||||||
|
)
|
||||||
assert segment_info.should_discard_segment(RetainModeEnum.motion)
|
assert segment_info.should_discard_segment(RetainModeEnum.motion)
|
||||||
assert not segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
assert not segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
||||||
|
|
||||||
def test_all_should_keep_all(self):
|
def test_all_should_keep_all(self):
|
||||||
segment_info = SegmentInfo(motion_area=0, active_object_count=0, average_dBFS=0)
|
segment_info = SegmentInfo(
|
||||||
|
motion_area=0, active_object_count=0, region_count=0, average_dBFS=0
|
||||||
|
)
|
||||||
assert not segment_info.should_discard_segment(RetainModeEnum.all)
|
assert not segment_info.should_discard_segment(RetainModeEnum.all)
|
||||||
|
|
||||||
def test_should_keep_audio_in_motion_mode(self):
|
def test_should_keep_audio_in_motion_mode(self):
|
||||||
segment_info = SegmentInfo(motion_area=0, active_object_count=0, average_dBFS=1)
|
segment_info = SegmentInfo(
|
||||||
|
motion_area=0, active_object_count=0, region_count=0, average_dBFS=1
|
||||||
|
)
|
||||||
assert not segment_info.should_discard_segment(RetainModeEnum.motion)
|
assert not segment_info.should_discard_segment(RetainModeEnum.motion)
|
||||||
assert segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
assert segment_info.should_discard_segment(RetainModeEnum.active_objects)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user