mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Fix attribute in sentry data_filter (#1920)
This commit is contained in:
parent
fc83cb9559
commit
b51f9586c4
@ -31,7 +31,7 @@ def filter_data(coresys: CoreSys, event: dict, hint: dict) -> dict:
|
||||
return None
|
||||
|
||||
# Ignore issue if system is not supported or diagnostics is disabled
|
||||
if not coresys.config.diagnostics or not coresys.supported or dev_env:
|
||||
if not coresys.config.diagnostics or not coresys.core.supported or dev_env:
|
||||
return None
|
||||
|
||||
# Not full startup - missing information
|
||||
|
@ -17,21 +17,21 @@ def test_ignored_exception(coresys):
|
||||
def test_diagnostics_disabled(coresys):
|
||||
"""Test if diagnostics is disabled."""
|
||||
coresys.config.diagnostics = False
|
||||
coresys.supported = True
|
||||
coresys.core.supported = True
|
||||
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
|
||||
|
||||
|
||||
def test_not_supported(coresys):
|
||||
"""Test if not supported."""
|
||||
coresys.config.diagnostics = True
|
||||
coresys.supported = False
|
||||
coresys.core.supported = False
|
||||
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
|
||||
|
||||
|
||||
def test_is_dev(coresys):
|
||||
"""Test if dev."""
|
||||
coresys.config.diagnostics = True
|
||||
coresys.supported = True
|
||||
coresys.core.supported = True
|
||||
with patch("os.environ", return_value=[("ENV_SUPERVISOR_DEV", "1")]):
|
||||
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
|
||||
|
||||
@ -39,7 +39,7 @@ def test_is_dev(coresys):
|
||||
def test_not_started(coresys):
|
||||
"""Test if supervisor not fully started."""
|
||||
coresys.config.diagnostics = True
|
||||
coresys.supported = True
|
||||
coresys.core.supported = True
|
||||
|
||||
coresys.core.state = CoreStates.INITIALIZE
|
||||
assert filter_data(coresys, SAMPLE_EVENT, {}) == SAMPLE_EVENT
|
||||
|
Loading…
x
Reference in New Issue
Block a user