heartbeat test fixed

This commit is contained in:
zurdi
2023-11-02 14:04:12 +01:00
parent 6ae9106844
commit dd2ecb4399
2 changed files with 28 additions and 11 deletions

View File

@@ -8,14 +8,32 @@ client = TestClient(app)
def test_heartbeat():
response = client.get("/heartbeat")
assert response.status_code == 200
print(response.json())
assert response.json() == {
'ROMM_AUTH_ENABLED': True,
'ENABLE_RESCAN_ON_FILESYSTEM_CHANGE': True,
'ENABLE_SCHEDULED_RESCAN': True,
'ENABLE_SCHEDULED_UPDATE_SWITCH_TITLEDB': True,
'ENABLE_SCHEDULED_UPDATE_MAME_XML': True,
'RESCAN_ON_FILESYSTEM_CHANGE_DELAY': 5,
'SCHEDULED_RESCAN_CRON': '0 3 * * *',
'SCHEDULED_UPDATE_SWITCH_TITLEDB_CRON': '0 4 * * *',
'SCHEDULED_UPDATE_MAME_XML_CRON': '0 5 * * *',
"ROMM_AUTH_ENABLED": True,
"WATCHER": {
"ENABLED": True,
"TITLE": "Rescan on filesystem change",
"MESSAGE": "Runs a scan when a change is detected in the library path, with a 5 minutes delay",
},
"SCHEDULER": {
"RESCAN": {
"ENABLED": True,
"CRON": "0 3 * * *",
"TITLE": "Scheduled rescan",
"MESSAGE": "Rescans the entire library",
},
"SWITCH_TITLEDB": {
"ENABLED": True,
"CRON": "0 4 * * *",
"TITLE": "Scheduled Switch TitleDB update",
"MESSAGE": "Updates the Nintedo Switch TitleDB file",
},
"MAME_XML": {
"ENABLED": True,
"CRON": "0 5 * * *",
"TITLE": "Scheduled MAME XML update",
"MESSAGE": "Updates the Nintedo MAME XML file",
},
},
}

View File

@@ -81,8 +81,7 @@ def heartbeat():
"WATCHER": {
"ENABLED": ENABLE_RESCAN_ON_FILESYSTEM_CHANGE,
"TITLE": "Rescan on filesystem change",
"MESSAGE": f"Runs a scan when a change is detected in the library path, \
with a {RESCAN_ON_FILESYSTEM_CHANGE_DELAY} minutes delay",
"MESSAGE": f"Runs a scan when a change is detected in the library path, with a {RESCAN_ON_FILESYSTEM_CHANGE_DELAY} minutes delay",
},
"SCHEDULER": {
"RESCAN": {