mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Formatting
This commit is contained in:
parent
448501fe22
commit
3754f66ace
@ -6,12 +6,10 @@ 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)
|
||||
|
||||
@ -627,6 +627,7 @@ def load_labels(path, encoding="utf-8"):
|
||||
else:
|
||||
return {index: line.strip() for index, line in enumerate(lines)}
|
||||
|
||||
|
||||
def clean_camera_user_pass(line: str) -> str:
|
||||
"""Removes user and password from line."""
|
||||
return re.sub(REGEX_CAMERA_USER_PASS, "*:*@", line)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user