mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Add tests
This commit is contained in:
parent
5db4bc35f8
commit
448501fe22
24
frigate/test/test_camera_pw_clean.py
Normal file
24
frigate/test/test_camera_pw_clean.py
Normal file
@ -0,0 +1,24 @@
|
||||
"""Test camera user and password cleanup."""
|
||||
|
||||
import unittest
|
||||
|
||||
from frigate.util import clean_camera_user_pass
|
||||
|
||||
|
||||
class TestUserPassCleanup(unittest.TestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.rtsp_with_pass = "rtsp://user:password@192.168.0.2:554/live"
|
||||
self.rtsp_no_pass = "rtsp://192.168.0.3/live"
|
||||
|
||||
|
||||
def test_cleanup(self):
|
||||
"""Test that user / pass are cleaned up."""
|
||||
clean = clean_camera_user_pass(self.rtsp_with_pass)
|
||||
assert clean != self.rtsp_with_pass
|
||||
assert "user:password" not in self.rtsp_with_pass
|
||||
|
||||
def test_no_cleanup(self):
|
||||
"""Test that nothing changes when no user / pass are defined."""
|
||||
clean = clean_camera_user_pass(self.rtsp_no_pass)
|
||||
assert clean == self.rtsp_no_pass
|
||||
Loading…
Reference in New Issue
Block a user