feat(automation): 持久执行队列与重复充值确认
This commit is contained in:
@@ -10,6 +10,7 @@ from tests.support.db import init_test_schema, make_test_session
|
||||
from web.backend.models import (
|
||||
Account,
|
||||
DouyuTask,
|
||||
ExecutionJob,
|
||||
PlatformFulfillmentEvent,
|
||||
PlatformFulfillmentTask,
|
||||
User,
|
||||
@@ -262,12 +263,6 @@ def test_platform_exchange_checks_eligibility_before_creating_task(monkeypatch):
|
||||
"refresh_exchange_eligibility",
|
||||
fake_refresh,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
douyu_router,
|
||||
"start_douyu_batch",
|
||||
lambda **_kwargs: None,
|
||||
)
|
||||
|
||||
result = asyncio.run(
|
||||
douyu_router.create_task_batch(
|
||||
DouyuTaskBatchRequest(
|
||||
@@ -287,6 +282,12 @@ def test_platform_exchange_checks_eligibility_before_creating_task(monkeypatch):
|
||||
assert result["count"] == 1
|
||||
created = db.query(DouyuTask).filter(DouyuTask.batch_id == result["batch_id"]).one()
|
||||
assert created.platform_task_id == task.id
|
||||
job = (
|
||||
db.query(ExecutionJob)
|
||||
.filter(ExecutionJob.batch_id == result["batch_id"])
|
||||
.one()
|
||||
)
|
||||
assert job.status == "queued"
|
||||
event = (
|
||||
db.query(PlatformFulfillmentEvent)
|
||||
.filter(
|
||||
|
||||
Reference in New Issue
Block a user