← Về thư mục
tests/test_doubao_search.py
- _deterministic_dns · function · L56-L69 — def _deterministic_dns(monkeypatch)
- _offline_dns · function · L59-L67 — def _offline_dns(host, port, _args, *_kwargs)
- _Response · class · L72-L92 — class _Response(io.BytesIO)
- init · method · L75-L83 — def init(self, payload: object | bytes)
- enter · method · L85-L86 — def enter(self)
- exit · method · L88-L89 — def exit(self, *_exc) -> None
- getcode · method · L91-L92 — def getcode(self) -> int
- _RetiringSocket · class · L95-L116 — class _RetiringSocket
- init · method · L103-L105 — def init(self)
- settimeout · method · L107-L110 — def settimeout(self, value)
- fileno · method · L112-L113 — def fileno(self) -> int
- close · method · L115-L116 — def close(self) -> None
- _EndOfBodyClosingResponse · class · L119-L184 — class _EndOfBodyClosingResponse
- init · method · L131-L149 — def init( self, payload, *, chunk_bytes: int = 16, declared_extra: int = 0, )
- enter · method · L151-L152 — def enter(self)
- exit · method · L154-L155 — def exit(self, *_exc) -> None
- getcode · method · L157-L158 — def getcode(self) -> int
- isclosed · method · L160-L161 — def isclosed(self) -> bool
- read · method · L163-L164 — def read(self, _args, *_kwargs): # pragma: no cover - must stay unused
- read1 · method · L166-L177 — def read1(self, size=-1)
- close · method · L179-L180 — def close(self) -> None
- _retire · method · L182-L184 — def _retire(self) -> None
- _http_wire · function · L187-L195 — def _http_wire(payload) -> bytes
- _RecordingOpener · class · L198-L223 — class _RecordingOpener
- init · method · L199-L202 — def init(self, replies)
- open · method · L204-L223 — def open(self, request, timeout=None): # noqa: ANN001
- _store · function · L226-L227 — def _store(tmp_path: Path) -> Store
- _successful_payload · function · L230-L242 — def _successful_payload(title: str = "Official Doubao Search result") -> dict
- _service · function · L245-L249 — def _service(tmp_path: Path, opener, secret: str = _OLD_SECRET)
- _headers · function · L252-L253 — def _headers(request) -> dict[str, str]: # noqa: ANN001
- test_fixed_endpoint_headers_body_and_normalized_success · function · L256-L298 — def test_fixed_endpoint_headers_body_and_normalized_success(tmp_path, caplog)
- test_credential_is_resolved_for_each_request_so_rotation_is_immediate · function · L301-L316 — def test_credential_is_resolved_for_each_request_so_rotation_is_immediate(tmp_path)
- test_no_key_is_not_a_search_success_and_makes_no_request · function · L319-L327 — def test_no_key_is_not_a_search_success_and_makes_no_request(tmp_path)
- test_primary_search_uses_doubao_and_never_calls_fallback_when_configured · function · L330-L348 — def test_primary_search_uses_doubao_and_never_calls_fallback_when_configured( tmp_path, )
- fallback · function · L337-L339 — def fallback(args, *kwargs)
- test_primary_search_falls_back_only_when_no_agent_plan_key_exists · function · L351-L371 — def test_primary_search_falls_back_only_when_no_agent_plan_key_exists(tmp_path)
- fallback · function · L356-L363 — def fallback(query, *, num_results, timeout)
- test_host_web_search_context_is_bound_to_each_dispatchers_store · function · L374-L445 — def test_host_web_search_context_is_bound_to_each_dispatchers_store(tmp_path)
- test_primary_search_has_no_direct_host_wire_method · function · L448-L459 — def test_primary_search_has_no_direct_host_wire_method(tmp_path)
- test_auth_and_quota_errors_are_hard_doubao_failures_not_empty_successes · function · L478-L501 — def test_auth_and_quota_errors_are_hard_doubao_failures_not_empty_successes( tmp_path, code, caplog )
- test_primary_search_never_falls_back_after_a_configured_key_is_rejected · function · L504-L527 — def test_primary_search_never_falls_back_after_a_configured_key_is_rejected( tmp_path, )
- fallback · function · L519-L521 — def fallback(args, *kwargs)
- test_short_invalid_key_is_never_reported_configured_or_sent · function · L530-L541 — def test_short_invalid_key_is_never_reported_configured_or_sent(tmp_path)
- test_invalid_active_ark_key_cannot_hide_behind_valid_dedicated_state · function · L544-L559 — def test_invalid_active_ark_key_cannot_hide_behind_valid_dedicated_state(tmp_path)
- test_reflected_credential_is_removed_before_results_leave_the_service · function · L562-L588 — def test_reflected_credential_is_removed_before_results_leave_the_service( tmp_path, caplog )
- test_provider_prose_cannot_bypass_the_existing_web_search_screen · function · L591-L616 — def test_provider_prose_cannot_bypass_the_existing_web_search_screen(tmp_path)
- test_redirect_is_refused_and_its_location_cannot_reflect_the_bearer · function · L619-L637 — def test_redirect_is_refused_and_its_location_cannot_reflect_the_bearer(tmp_path)
- test_response_body_is_bounded_while_reading · function · L640-L645 — def test_response_body_is_bounded_while_reading(tmp_path)
- test_body_reader_returns_after_each_raw_read_to_recheck_deadline · function · L648-L656 — def test_body_reader_returns_after_each_raw_read_to_recheck_deadline(tmp_path)
- _Read1OnlyResponse · class · L649-L651 — class _Read1OnlyResponse(_Response)
- read · method · L650-L651 — def read(self, _args, *_kwargs): # pragma: no cover - must stay unused
- test_a_completely_read_body_is_not_reported_as_a_failed_request · function · L659-L688 — def test_a_completely_read_body_is_not_reported_as_a_failed_request(tmp_path)
- test_a_body_cut_short_of_content_length_is_a_transport_failure · function · L691-L702 — def test_a_body_cut_short_of_content_length_is_a_transport_failure(tmp_path)
- test_body_exhaustion_requires_exact_stdlib_signals · function · L705-L719 — def test_body_exhaustion_requires_exact_stdlib_signals()
- _RaisingClosedProbe · class · L706-L710 — class _RaisingClosedProbe
- isclosed · method · L709-L710 — def isclosed(self)
- test_a_socket_urllib_already_closed_still_takes_its_read_bound · function · L722-L748 — def test_a_socket_urllib_already_closed_still_takes_its_read_bound()
- test_a_watchdog_close_is_reported_as_the_deadline_not_as_a_bare_oserror · function · L751-L782 — def test_a_watchdog_close_is_reported_as_the_deadline_not_as_a_bare_oserror()
- _watchdog_wins_the_gap · function · L770-L773 — def _watchdog_wins_the_gap()
- test_a_real_socket_exchange_survives_the_stdlib_end_of_body_close · function · L785-L844 — def test_a_real_socket_exchange_survives_the_stdlib_end_of_body_close( tmp_path, monkeypatch )
- _build_opener · function · L807-L818 — def _build_opener(exchange, *handlers)
- _SocketpairConnection · class · L808-L812 — class _SocketpairConnection(_DeadlineHTTPSConnection)
- connect · method · L809-L812 — def connect(self) -> None
- test_malformed_or_unproven_success_is_rejected · function · L857-L862 — def test_malformed_or_unproven_success_is_rejected(tmp_path, payload)
- test_gateway_config_and_dedicated_search_keep_the_strict_product_gate · function · L865-L1027 — def test_gateway_config_and_dedicated_search_keep_the_strict_product_gate( tmp_path, monkeypatch, caplog )
- _Hub · class · L872-L877 — class _Hub
- emitter · method · L873-L874 — def emitter(self, root_frame_id)
- broadcast · method · L876-L877 — def broadcast(self, root_frame_id, event)
- _MCPManager · class · L881-L883 — class _MCPManager
- disconnect · method · L882-L883 — def disconnect(self, connector_id, cache_scope=None)
- _FakeDoubaoSearchService · class · L885-L941 — class _FakeDoubaoSearchService
- init · method · L886-L887 — def init(self, store)
- configured · method · L889-L890 — def configured(self)
- search · method · L892-L941 — def search(self, query, *, num_results=8, timeout=20.0)