中国城市电报推送接入 AMSC AWOS 跑道报文温度
Constraint: 仅当 amos 数据含 raw_metar 时才追加 AMSC 块,不影响非中国城市
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
from scripts.grant_subscription_by_email import _select_exact_user_id
|
||||
from src.payments.contract_checkout import PaymentCheckoutError
|
||||
|
||||
|
||||
def test_select_exact_user_id_prefers_exact_email_match():
|
||||
payload = {
|
||||
"users": [
|
||||
{"id": "wrong-user", "email": "louischanre+alias@gmail.com"},
|
||||
{"id": "right-user", "email": "louischanre@gmail.com"},
|
||||
]
|
||||
}
|
||||
|
||||
result = _select_exact_user_id(payload, "louischanre@gmail.com")
|
||||
|
||||
assert result == "right-user"
|
||||
|
||||
|
||||
def test_select_exact_user_id_raises_when_exact_email_missing():
|
||||
payload = {
|
||||
"users": [
|
||||
{"id": "wrong-user", "email": "louischanre+alias@gmail.com"},
|
||||
]
|
||||
}
|
||||
|
||||
try:
|
||||
_select_exact_user_id(payload, "louischanre@gmail.com")
|
||||
except PaymentCheckoutError as exc:
|
||||
assert exc.status_code == 404
|
||||
else:
|
||||
raise AssertionError("expected PaymentCheckoutError")
|
||||
Reference in New Issue
Block a user