........FFFF............................................................ [ 2%] ........................................................................ [ 4%] ........................................................................ [ 7%] ....................F................................................... [ 9%] ........................................................................ [ 12%] ........................................................................ [ 14%] ........................................................................ [ 17%] ........................................................................ [ 19%] ........................................................................ [ 22%] ........................................................................ [ 24%] ........................................................................ [ 26%] ........................................................................ [ 29%] ........................................................................ [ 31%] ........................................................................ [ 34%] ........................................................................ [ 36%] ........................................................................ [ 39%] ........................................................................ [ 41%] ........................................................................ [ 44%] ........................................................................ [ 46%] ........................................................................ [ 48%] ........................................................................ [ 51%] ........................................................................ [ 53%] ........................................................................ [ 56%] ........................................................................ [ 58%] ........................................................ss.............. [ 61%] ........................................................................ [ 63%] ........................................................................ [ 66%] ........................................................................ [ 68%] ........................................................................ [ 71%] ...................................................s.........s.......... [ 73%] ........................................................................ [ 75%] ........................................................................ [ 78%] ........................................................................ [ 80%] ........................................................................ [ 83%] ........................................................................ [ 85%] ........................................................................ [ 88%] ........................................................................ [ 90%] ........................................................................ [ 93%] ........................................................................ [ 95%] ........................................................................ [ 97%] ........................................................... [100%] =================================== FAILURES =================================== _____________ test_get_active_naver_keys_returns_primary_initially _____________ def test_get_active_naver_keys_returns_primary_initially(): """_get_active_naver_keys()가 초기 상태에서 Primary 키를 반환해야 한다.""" import daily_trend_collect as dtc client_id, client_secret = dtc._get_active_naver_keys() > assert client_id == "primary-id" E AssertionError: assert 'Cd34UTbU29wooPrsSYSk' == 'primary-id' E E - primary-id E + Cd34UTbU29wooPrsSYSk scripts/tests/test_standby_fallback.py:56: AssertionError _____________ test_standby_switch_after_three_consecutive_failures _____________ def test_standby_switch_after_three_consecutive_failures(): """_on_api_failure() 3회 호출 후 _get_active_naver_keys()가 Standby 키를 반환해야 한다.""" import daily_trend_collect as dtc # Primary 키 상태 확인 cid, csec = dtc._get_active_naver_keys() > assert cid == "primary-id" E AssertionError: assert 'Cd34UTbU29wooPrsSYSk' == 'primary-id' E E - primary-id E + Cd34UTbU29wooPrsSYSk scripts/tests/test_standby_fallback.py:70: AssertionError ______________ test_success_resets_fail_counter_and_keeps_primary ______________ def test_success_resets_fail_counter_and_keeps_primary(): """_on_api_failure() 2회 후 _on_api_success() 호출 시 카운터가 리셋되어 Primary를 유지해야 한다.""" import daily_trend_collect as dtc # 2회 실패 (임계값 3에 미달) dtc._on_api_failure() dtc._on_api_failure() assert dtc._primary_fail_count == 2 assert dtc._using_standby is False # 성공 → 카운터 리셋 dtc._on_api_success() assert dtc._primary_fail_count == 0 assert dtc._using_standby is False # 여전히 Primary 키 반환 cid, csec = dtc._get_active_naver_keys() > assert cid == "primary-id" E AssertionError: assert 'Cd34UTbU29wooPrsSYSk' == 'primary-id' E E - primary-id E + Cd34UTbU29wooPrsSYSk scripts/tests/test_standby_fallback.py:107: AssertionError ____________________ test_primary_recovery_after_30_minutes ____________________ monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x77ea5afb1df0> def test_primary_recovery_after_30_minutes(monkeypatch): """Standby 전환 후 30분(1800초) 경과 시 _get_active_naver_keys()가 Primary 키로 복귀해야 한다.""" import daily_trend_collect as dtc # 3회 실패로 Standby 전환 dtc._on_api_failure() dtc._on_api_failure() dtc._on_api_failure() assert dtc._using_standby is True # Standby 전환 시각을 현재보다 1900초(31분) 이전으로 조작 fake_switch_time = time.time() - 1900.0 dtc._standby_switch_time = fake_switch_time # time.time()을 switch_time + 1900으로 고정 monkeypatch.setattr(dtc.time, "time", lambda: fake_switch_time + 1900.0) # 30분 경과 → Primary 복귀 cid, csec = dtc._get_active_naver_keys() assert dtc._using_standby is False > assert cid == "primary-id" E AssertionError: assert 'Cd34UTbU29wooPrsSYSk' == 'primary-id' E E - primary-id E + Cd34UTbU29wooPrsSYSk scripts/tests/test_standby_fallback.py:135: AssertionError ------------------------------ Captured log call ------------------------------- WARNING daily_trend_collect:daily_trend_collect.py:112 Primary 키 연속 3회 실패 → Standby 키로 전환 _________________ test_cors_fail_closed_when_ext_origin_unset __________________ def test_cors_fail_closed_when_ext_origin_unset(): """INSURO_EXTENSION_ORIGIN 미설정 → 확장 origin 미허용(fail-closed). 기존 웹앱 origin 은 유지.""" result = _probe_cors(None) origins = result["origins"] assert _EXISTING_WEBAPP_ORIGIN in origins # 회귀 0 > assert not any(o.startswith("chrome-extension://") for o in origins) E assert not True E + where True = any(. at 0x77ea5e3a4ba0>) tests/test_consultation_history_get.py:435: AssertionError =============================== warnings summary =============================== main.py:273 /home/jay/projects/InsuRo/server/main.py:273: DeprecationWarning: on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). @app.on_event("startup") ../../../.local/lib/python3.12/site-packages/fastapi/applications.py:4599 ../../../.local/lib/python3.12/site-packages/fastapi/applications.py:4599 tests/test_smart_parse_hybrid.py::TestSmartParseFileScenarioA::test_text_pdf_no_vision_call tests/test_smart_parse_hybrid.py::TestSmartParseFileScenarioA::test_text_pdf_no_vision_call /home/jay/.local/lib/python3.12/site-packages/fastapi/applications.py:4599: DeprecationWarning: on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). return self.router.on_event(event_type) main.py:298 /home/jay/projects/InsuRo/server/main.py:298: DeprecationWarning: on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). @app.on_event("shutdown") tests/test_e2e_flows.py::TestAuthAndPlanFlows::test_e2e_plan_upgrade_flow tests/test_e2e_flows.py::TestSecurityPenetration::test_g4_3_multi_account_detection_logging /home/jay/.local/lib/python3.12/site-packages/supabase/_sync/client.py:309: DeprecationWarning: The 'timeout' parameter is deprecated. Please configure it in the http client instead. return SyncPostgrestClient( tests/test_e2e_flows.py::TestAuthAndPlanFlows::test_e2e_plan_upgrade_flow tests/test_e2e_flows.py::TestSecurityPenetration::test_g4_3_multi_account_detection_logging /home/jay/.local/lib/python3.12/site-packages/supabase/_sync/client.py:309: DeprecationWarning: The 'verify' parameter is deprecated. Please configure it in the http client instead. return SyncPostgrestClient( tests/test_generate_content.py::TestGenerateContentChannelRestriction::test_free_plan_tistory_channel_returns_403 tests/test_generate_content.py::TestGenerateContentSuccessFlow::test_normal_flow_returns_job_queued /home/jay/.local/lib/python3.12/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 126, in __del__ self.close() File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 104, in close proto.pipe.close() File "/usr/lib/python3.12/asyncio/unix_events.py", line 568, in close self._close(None) File "/usr/lib/python3.12/asyncio/unix_events.py", line 592, in _close self._loop.call_soon(self._call_connection_lost, exc) File "/usr/lib/python3.12/asyncio/base_events.py", line 795, in call_soon self._check_closed() File "/usr/lib/python3.12/asyncio/base_events.py", line 541, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) tests/test_generate_content.py::TestGenerateContentSuccessFlow::test_monthly_limit_exceeded_returns_429 /home/jay/.local/lib/python3.12/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: Traceback (most recent call last): File "/home/jay/.local/lib/python3.12/site-packages/jwt/api_jws.py", line 293, in _load signing_input, crypto_segment = jwt.rsplit(b".", 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 2, got 1) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/jay/projects/InsuRo/server/main.py", line 393, in multi_account_detect_middleware signing_key = jwks_client.get_signing_key_from_jwt(token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jay/.local/lib/python3.12/site-packages/jwt/jwks_client.py", line 114, in get_signing_key_from_jwt unverified = decode_token(token, options={"verify_signature": False}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jay/.local/lib/python3.12/site-packages/jwt/api_jwt.py", line 268, in decode_complete decoded = self._jws.decode_complete( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jay/.local/lib/python3.12/site-packages/jwt/api_jws.py", line 233, in decode_complete payload, signing_input, header, signature = self._load(jwt) ^^^^^^^^^^^^^^^ File "/home/jay/.local/lib/python3.12/site-packages/jwt/api_jws.py", line 296, in _load raise DecodeError("Not enough segments") from err jwt.exceptions.DecodeError: Not enough segments During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 126, in __del__ self.close() File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 104, in close proto.pipe.close() File "/usr/lib/python3.12/asyncio/unix_events.py", line 568, in close self._close(None) File "/usr/lib/python3.12/asyncio/unix_events.py", line 592, in _close self._loop.call_soon(self._call_connection_lost, exc) File "/usr/lib/python3.12/asyncio/base_events.py", line 795, in call_soon self._check_closed() File "/usr/lib/python3.12/asyncio/base_events.py", line 541, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) tests/test_main.py: 9 warnings tests/test_onboarding.py: 16 warnings /home/jay/.local/lib/python3.12/site-packages/jwt/api_jwt.py:153: InsecureKeyLengthWarning: The HMAC key is 15 bytes long, which is below the minimum recommended length of 32 bytes for SHA256. See RFC 7518 Section 3.2. return self._jws.encode( tests/test_smart_parse_hybrid.py::TestSmartParseFileScenarioA::test_text_pdf_no_vision_call /home/jay/projects/InsuRo/server/tests/../main.py:273: DeprecationWarning: on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). @app.on_event("startup") tests/test_smart_parse_hybrid.py::TestSmartParseFileScenarioA::test_text_pdf_no_vision_call /home/jay/projects/InsuRo/server/tests/../main.py:298: DeprecationWarning: on_event is deprecated, use lifespan event handlers instead. Read more about it in the [FastAPI docs for Lifespan Events](https://fastapi.tiangolo.com/advanced/events/). @app.on_event("shutdown") -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED scripts/tests/test_standby_fallback.py::test_get_active_naver_keys_returns_primary_initially FAILED scripts/tests/test_standby_fallback.py::test_standby_switch_after_three_consecutive_failures FAILED scripts/tests/test_standby_fallback.py::test_success_resets_fail_counter_and_keeps_primary FAILED scripts/tests/test_standby_fallback.py::test_primary_recovery_after_30_minutes FAILED tests/test_consultation_history_get.py::test_cors_fail_closed_when_ext_origin_unset 5 failed, 2930 passed, 4 skipped, 40 warnings in 182.83s (0:03:02)