| 123456789101112131415161718192021222324 |
- # tests/test_live_t01.py
- """Task 8: [live] T01 端到端 — 无客户端创角(逐鹿05区 14481607)。
- 默认跳过(pytest.ini addopts -m "not live");真实网关显式:
- protocol_bot/.venv/bin/python -m pytest tests/test_live_t01.py -m live -v -s
- """
- import random
- import pytest
- from apilot.host import Host
- pytestmark = pytest.mark.live
- def test_t01_create_role_headless():
- name = "萌新" + str(random.randint(1000, 9999))
- h = Host(14481607, "longwu988", "Longwu1988", state_dir="/tmp/apilot_t01")
- h.http_login()
- h.boot_lua()
- result = h.run_create_role(name=name) # 内部: connect→2001链→101→521
- assert result["role_name"] == name
- assert result["ticket"] # 521 票据非空
- assert h.nc.get_sdata() != 0 # 530 sid 已注入
|