Reuse constants (#16874)

This commit is contained in:
Martin Weinelt
2025-02-28 21:35:09 -07:00
committed by GitHub
parent 06d6e21de8
commit 458134de5d
16 changed files with 55 additions and 30 deletions
+4 -3
View File
@@ -10,6 +10,7 @@ from pydantic import Json
from frigate.api.fastapi_app import create_fastapi_app
from frigate.config import FrigateConfig
from frigate.const import BASE_DIR, CACHE_DIR
from frigate.models import Event, Recordings, ReviewSegment
from frigate.review.types import SeverityEnum
from frigate.test.const import TEST_DB, TEST_DB_CLEANUPS
@@ -73,19 +74,19 @@ class BaseTestHttp(unittest.TestCase):
"total": 67.1,
"used": 16.6,
},
"/media/frigate/clips": {
os.path.join(BASE_DIR, "clips"): {
"free": 42429.9,
"mount_type": "ext4",
"total": 244529.7,
"used": 189607.0,
},
"/media/frigate/recordings": {
os.path.join(BASE_DIR, "recordings"): {
"free": 0.2,
"mount_type": "ext4",
"total": 8.0,
"used": 7.8,
},
"/tmp/cache": {
CACHE_DIR: {
"free": 976.8,
"mount_type": "tmpfs",
"total": 1000.0,
+2 -2
View File
@@ -854,9 +854,9 @@ class TestConfig(unittest.TestCase):
assert frigate_config.model.merged_labelmap[0] == "person"
def test_plus_labelmap(self):
with open("/config/model_cache/test", "w") as f:
with open(os.path.join(MODEL_CACHE_DIR, "test"), "w") as f:
json.dump(self.plus_model_info, f)
with open("/config/model_cache/test.json", "w") as f:
with open(os.path.join(MODEL_CACHE_DIR, "test.json"), "w") as f:
json.dump(self.plus_model_info, f)
config = {
+4 -3
View File
@@ -11,6 +11,7 @@ from playhouse.sqliteq import SqliteQueueDatabase
from frigate.api.fastapi_app import create_fastapi_app
from frigate.config import FrigateConfig
from frigate.const import BASE_DIR, CACHE_DIR
from frigate.models import Event, Recordings, Timeline
from frigate.test.const import TEST_DB, TEST_DB_CLEANUPS
@@ -74,19 +75,19 @@ class TestHttp(unittest.TestCase):
"total": 67.1,
"used": 16.6,
},
"/media/frigate/clips": {
os.path.join(BASE_DIR, "clips"): {
"free": 42429.9,
"mount_type": "ext4",
"total": 244529.7,
"used": 189607.0,
},
"/media/frigate/recordings": {
os.path.join(BASE_DIR, "recordings"): {
"free": 0.2,
"mount_type": "ext4",
"total": 8.0,
"used": 7.8,
},
"/tmp/cache": {
CACHE_DIR: {
"free": 976.8,
"mount_type": "tmpfs",
"total": 1000.0,