mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-09 21:41:15 +03:00
backend test
This commit is contained in:
parent
3c9fe6fa0f
commit
cabe7dc1b1
@ -2,6 +2,7 @@ from unittest.mock import Mock, patch
|
|||||||
|
|
||||||
import frigate.genai
|
import frigate.genai
|
||||||
from frigate.config import GenAIProviderEnum
|
from frigate.config import GenAIProviderEnum
|
||||||
|
from frigate.const import REDACTED_CREDENTIAL_SENTINEL
|
||||||
from frigate.genai import GenAIClient
|
from frigate.genai import GenAIClient
|
||||||
from frigate.models import Event, Recordings, ReviewSegment
|
from frigate.models import Event, Recordings, ReviewSegment
|
||||||
from frigate.stats.emitter import StatsEmitter
|
from frigate.stats.emitter import StatsEmitter
|
||||||
@ -75,6 +76,20 @@ class TestHttpApp(BaseTestHttp):
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert app.frigate_config.cameras["front_door"].objects.track == ["person"]
|
assert app.frigate_config.cameras["front_door"].objects.track == ["person"]
|
||||||
|
|
||||||
|
####################################################################################################################
|
||||||
|
################################### Credential redaction sentinel ################################################
|
||||||
|
####################################################################################################################
|
||||||
|
def test_config_response_redacts_mqtt_password_with_sentinel(self):
|
||||||
|
self.minimal_config["mqtt"]["user"] = "mqttuser"
|
||||||
|
self.minimal_config["mqtt"]["password"] = "supersecret"
|
||||||
|
app = super().create_app()
|
||||||
|
|
||||||
|
with AuthTestClient(app) as client:
|
||||||
|
response = client.get("/config")
|
||||||
|
assert response.status_code == 200
|
||||||
|
mqtt = response.json()["mqtt"]
|
||||||
|
assert mqtt["password"] == REDACTED_CREDENTIAL_SENTINEL
|
||||||
|
|
||||||
####################################################################################################################
|
####################################################################################################################
|
||||||
################################### POST /genai/probe Endpoint ##################################################
|
################################### POST /genai/probe Endpoint ##################################################
|
||||||
####################################################################################################################
|
####################################################################################################################
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user