#!/usr/bin/env python3
"""
【12】刷新企业授权令牌 —— 授权快到期时续期（测试环境拿不到成功结果）
中台路径：POST /api/v1/icbc/enterprise/refresh-auth
正确送法（工行已确认）：archiveType=01 + outVendorId。企业没有真实完成授权时工行回 10100099「业务繁忙」，
测试企业没有真实授权，所以测试环境固定 10100099，属正常；生产验证。
用法：先设好环境变量（见 kl_common.py 开头），再运行  python3 12_refresh_auth.py 
"""
import os, sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from kl_common import *  # noqa: F401,F403

body = {"outVendorId": VENDOR_ID, "archiveType": "01"}
resp, ok = run("12_refresh_auth", "/api/v1/icbc/enterprise/refresh-auth", body, expect="known", accept=("10100099",), notes=[
    "测试环境固定返回 10100099（测试企业没有真实授权），送法正确；企业真实授权后可正常刷新，生产验证。"])
