mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 02:29:19 +03:00
formatting
This commit is contained in:
parent
9efc2499f6
commit
61746984d1
@ -1,6 +1,5 @@
|
|||||||
"""Profile manager for activating/deactivating named config profiles."""
|
"""Profile manager for activating/deactivating named config profiles."""
|
||||||
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|||||||
@ -354,16 +354,12 @@ class TestProfilePersistence(unittest.TestCase):
|
|||||||
temp_path = f.name
|
temp_path = f.name
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with patch.object(
|
from pathlib import Path
|
||||||
ProfileManager, "_persist_active_profile"
|
|
||||||
) as mock_persist:
|
|
||||||
# Simulate writing
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
path = Path(temp_path)
|
path = Path(temp_path)
|
||||||
path.write_text("armed")
|
path.write_text("armed")
|
||||||
loaded = path.read_text().strip()
|
loaded = path.read_text().strip()
|
||||||
assert loaded == "armed"
|
assert loaded == "armed"
|
||||||
finally:
|
finally:
|
||||||
os.unlink(temp_path)
|
os.unlink(temp_path)
|
||||||
|
|
||||||
@ -374,8 +370,6 @@ class TestProfilePersistence(unittest.TestCase):
|
|||||||
temp_path = f.name
|
temp_path = f.name
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
with patch.object(type(PERSISTENCE_FILE), "exists", return_value=True):
|
with patch.object(type(PERSISTENCE_FILE), "exists", return_value=True):
|
||||||
with patch.object(
|
with patch.object(
|
||||||
type(PERSISTENCE_FILE), "read_text", return_value=""
|
type(PERSISTENCE_FILE), "read_text", return_value=""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user