refactor(core)!: drop leading underscores from internal definitions

Renames 314 defs and 41 module/class-level constants. Keeps 11 names underscored where the stripped form collides in scope, plus 5.5.0 shims for the three symbols external service repos call.
This commit is contained in:
imSp4rky
2026-08-15 22:07:41 -06:00
parent db4f0b39f9
commit 21d5f1c5e1
116 changed files with 1671 additions and 1492 deletions
+4 -4
View File
@@ -28,13 +28,13 @@ def serve_users(monkeypatch):
monkeypatch.setattr(handlers, "request_secret_key", lambda request: request.headers.get("X-Secret-Key"))
def _request(key):
def request(key):
return SimpleNamespace(headers={"X-Secret-Key": key} if key else {})
@pytest.mark.parametrize(("key", "allowed"), ENTITLEMENTS)
def test_server_cdm_allowed(serve_users, key, allowed):
assert handlers.server_cdm_allowed(_request(key)) is allowed
assert handlers.server_cdm_allowed(request(key)) is allowed
def test_no_request_allows(serve_users):
@@ -45,10 +45,10 @@ def test_no_request_allows(serve_users):
def test_download_gate_follows_entitlement(serve_users, key, allowed):
# A download job licenses with the server CDM, so submission obeys the same gate.
if allowed:
handlers.enforce_download_gates({}, _request(key))
handlers.enforce_download_gates({}, request(key))
else:
with pytest.raises(APIError) as ei:
handlers.enforce_download_gates({}, _request(key))
handlers.enforce_download_gates({}, request(key))
assert ei.value.error_code == APIErrorCode.FORBIDDEN