交易服务收敛为仅 rakuten:移除 rakuma 登录态与下单入口
trading 不再管理 ラクマ 的购物车购买、支付与订单监控。删除 auth_site / auth_session / login_runner / models.AuthSite 中的 rakuma 分支与常量、 account.yaml.example 的 rakuma 段,并清理相关测试。scraping 侧的 ラクマ 抓取 API(/api/rakuma/*)保留不动。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ class StubAuthSession:
|
||||
|
||||
@property
|
||||
def sites(self) -> tuple[str, ...]:
|
||||
return ("rakuten", "rakuma")
|
||||
return ("rakuten",)
|
||||
|
||||
def _status(self, site: str) -> AuthStatus:
|
||||
return AuthStatus(
|
||||
@@ -87,7 +87,7 @@ def test_health_needs_no_token(client):
|
||||
assert response.status_code == 200
|
||||
body = response.json()
|
||||
assert body["data"]["status"] == "ok"
|
||||
assert set(body["data"]["auth"]) == {"rakuten", "rakuma"}
|
||||
assert set(body["data"]["auth"]) == {"rakuten"}
|
||||
|
||||
|
||||
def test_health_does_not_probe_the_site(client, stub):
|
||||
@@ -116,12 +116,12 @@ def test_auth_endpoints_reject_wrong_token(client):
|
||||
# ---- 登录态查询 ----
|
||||
|
||||
|
||||
def test_status_probes_both_sites_by_default(client, stub):
|
||||
def test_status_probes_site_by_default(client, stub):
|
||||
response = client.post("/api/auth/status", json={}, headers=AUTH)
|
||||
assert response.status_code == 200
|
||||
body = response.json()
|
||||
assert [item["site"] for item in body["data"]["sites"]] == ["rakuten", "rakuma"]
|
||||
assert stub.checked == ["rakuten", "rakuma"]
|
||||
assert [item["site"] for item in body["data"]["sites"]] == ["rakuten"]
|
||||
assert stub.checked == ["rakuten"]
|
||||
|
||||
|
||||
def test_status_can_skip_the_probe(client, stub):
|
||||
@@ -132,9 +132,9 @@ def test_status_can_skip_the_probe(client, stub):
|
||||
|
||||
|
||||
def test_status_accepts_a_single_site(client, stub):
|
||||
response = client.post("/api/auth/status", json={"site": "rakuma"}, headers=AUTH)
|
||||
response = client.post("/api/auth/status", json={"site": "rakuten"}, headers=AUTH)
|
||||
assert response.status_code == 200
|
||||
assert stub.checked == ["rakuma"]
|
||||
assert stub.checked == ["rakuten"]
|
||||
|
||||
|
||||
def test_status_rejects_unknown_site(client):
|
||||
|
||||
Reference in New Issue
Block a user