Test der Speicher-Schnittstelle mit fester Uhr (die Sicherungen des Beispielberichts sind vom 25.09.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1915813cc0
commit
934088a8d9
@@ -6,6 +6,7 @@ import math
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from types import SimpleNamespace
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
@@ -259,6 +260,8 @@ def test_schnittstelle(monkeypatch):
|
|||||||
from routers import homelab
|
from routers import homelab
|
||||||
monkeypatch.setattr(speicher, "antwortet", lambda s, p: True)
|
monkeypatch.setattr(speicher, "antwortet", lambda s, p: True)
|
||||||
monkeypatch.setattr(speicher, "_bericht", lambda: _bericht())
|
monkeypatch.setattr(speicher, "_bericht", lambda: _bericht())
|
||||||
|
# Die Schnittstelle rechnet mit der Uhr: die Sicherungen des Berichts sind vom 25.09.2026 (am 26.09. rot geworden).
|
||||||
|
monkeypatch.setattr(speicher, "time", SimpleNamespace(time=lambda: JETZT, monotonic=time.monotonic))
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
app.include_router(homelab.router)
|
app.include_router(homelab.router)
|
||||||
daten = TestClient(app).get("/api/homelab/speicher").json()
|
daten = TestClient(app).get("/api/homelab/speicher").json()
|
||||||
|
|||||||
Reference in New Issue
Block a user