Refact: system apis (#14298)

### What problem does this PR solve?
Refact: system apis

### Type of change

- [x] Refactoring
This commit is contained in:
Magicbook1108
2026-04-23 14:09:42 +08:00
committed by GitHub
parent 57f527eb02
commit 76b017ca32
6 changed files with 185 additions and 207 deletions

View File

@@ -90,7 +90,7 @@ def system_delete_token(auth, token, *, headers=HEADERS):
def system_status(auth, params=None, *, headers=HEADERS):
res = requests.get(url=f"{HOST_ADDRESS}{SYSTEM_APP_URL}/status", headers=headers, auth=auth, params=params)
res = requests.get(url=f"{HOST_ADDRESS}{SYSTEM_API_URL}/status", headers=headers, auth=auth, params=params)
return res.json()
@@ -100,7 +100,7 @@ def system_version(auth, params=None, *, headers=HEADERS):
def system_config(auth=None, params=None, *, headers=HEADERS):
res = requests.get(url=f"{HOST_ADDRESS}{SYSTEM_APP_URL}/config", headers=headers, auth=auth, params=params)
res = requests.get(url=f"{HOST_ADDRESS}{SYSTEM_API_URL}/config", headers=headers, auth=auth, params=params)
return res.json()

View File

@@ -156,7 +156,7 @@ def _load_system_module(monkeypatch):
quart_mod.jsonify = lambda payload: payload
monkeypatch.setitem(sys.modules, "quart", quart_mod)
module_path = repo_root / "api" / "apps" / "system_app.py"
module_path = repo_root / "api" / "apps" / "restful_apis" / "system_api.py"
spec = importlib.util.spec_from_file_location("test_system_routes_unit_module", module_path)
module = importlib.util.module_from_spec(spec)
module.manager = _DummyManager()