Jobs reset saves data (#4007)

This commit is contained in:
Mike Degatano 2022-11-15 16:21:45 -05:00 committed by GitHub
parent 2809f23391
commit a8133f0640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,8 @@ class FileConfiguration:
_LOGGER.error(
"Can't reset %s: %s", self._file, humanize_error(self._data, ex)
)
else:
self.save_data()
def read_data(self) -> None:
"""Read configuration file."""

View File

@ -45,8 +45,10 @@ async def test_api_jobs_reset(api_client, coresys):
assert coresys.jobs.save_data.called
assert coresys.jobs.ignore_conditions == [JobCondition.HEALTHY]
coresys.jobs.save_data.reset_mock()
resp = await api_client.post("/jobs/reset")
result = await resp.json()
assert result["result"] == "ok"
assert coresys.jobs.ignore_conditions == []
coresys.jobs.save_data.assert_called_once()