feat(5.20): US-004/005/006/009 ingestie+API+worker+import pe mediu RAR
US-004: rezolva_rar_env (cerere>default cont>ancora globala) + MediuIndisponibil + cod RAR_MEDIU_INDISPONIBIL. US-005: camp rar_env pe POST /v1/prezentari + /valideaza (Literal), echo in SubmissionResult/ValidareResult/GET, build_key + INSERT env-aware. US-006: AccountSessions re-cheiat (account_id, rar_env); RarClient base_url per env; creds din slotul env; purge + recover_orphans scoped pe env (E1/1a, 1b/E6); claim_one propaga rar_env (1c/E8); keepalive pe ancora globala (M2). US-009: selector mediu la import (>=2 medii), eticheta la 1, banner la 0; commit seteaza rar_env pe submissions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ class FakeRar:
|
||||
def test_login_reusit_logat(env, monkeypatch):
|
||||
conn, settings = env
|
||||
import app.worker.__main__ as w
|
||||
monkeypatch.setattr(w, "RarClient", lambda s: FakeRar())
|
||||
monkeypatch.setattr(w, "RarClient", lambda s, **kw: FakeRar())
|
||||
sessions = w.AccountSessions(settings)
|
||||
tok = sessions.get_token(conn, 2, {"email": "a@b.ro", "password": "secretaXY"})
|
||||
assert tok == "JWT-TEST"
|
||||
@@ -80,7 +80,7 @@ def test_login_reusit_logat(env, monkeypatch):
|
||||
def test_login_401_logat_fara_parola(env, monkeypatch):
|
||||
conn, settings = env
|
||||
import app.worker.__main__ as w
|
||||
monkeypatch.setattr(w, "RarClient", lambda s: FakeRar(login_exc=RarAuthError("401", status_code=401)))
|
||||
monkeypatch.setattr(w, "RarClient", lambda s, **kw: FakeRar(login_exc=RarAuthError("401", status_code=401)))
|
||||
sessions = w.AccountSessions(settings)
|
||||
with pytest.raises(RarAuthError):
|
||||
sessions.get_token(conn, 3, {"email": "a@b.ro", "password": "parolaGRESITA"})
|
||||
|
||||
Reference in New Issue
Block a user