fix(performance): 11번가 연결 테스트 — XML 아닌 응답은 실패, 성공 알림은 초록 체크

- 11번가가 200 으로 웹페이지(IP 차단 안내 등)나 XML 아닌 응답을 주면 "0건 정상"으로
  오판할 수 있어 실패로 처리
- 공용 알림 창 erpAlert(msg, { tone: "ok" }) — 경고 삼각형 대신 초록 체크.
  기존 호출은 그대로. 실적 연결 테스트 성공 알림에 적용

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 00:40:40 +09:00
parent c93ab2fbd8
commit 6376092bb7
8 changed files with 31 additions and 12 deletions
@@ -842,13 +842,14 @@ def test_elevenst_connection():
assert "연결 정상" in msg and "2건" in msg and seen["key"] == "KEY-11ST-SECRET"
assert "/rest/ordservices/complete/" in seen["url"]
err = '<ns2:orders xmlns:ns2="x"><ns2:result_code>-1</ns2:result_code><ns2:result_text>허용되지 않은 IP</ns2:result_text></ns2:orders>'
for status, body, kind in ((200, err.encode(), ApiError), (403, b"Forbidden", AuthFailed)):
for status, body, kind in ((200, err.encode(), ApiError), (403, b"Forbidden", AuthFailed),
(200, b"<html><body>IP not allowed</body></html>", ApiError)):
httpx.get = fake(status, body)
try:
ev.ElevenstAdapter().test_connection(ctx)
except kind as exc:
assert "KEY-11ST-SECRET" not in exc.message
assert status == 403 or "허용되지 않은 IP" in exc.message
assert status == 403 or "허용되지 않은 IP" in exc.message or "XML 아님" in exc.message
else:
raise AssertionError("오류여야 합니다")
finally: