← Về thư mục
tests/test_cli_contract.py
- _cli_module · function · L19-L20 — def _cli_module()
- test_console_and_module_entrypoints_target_the_same_main · function · L23-L43 — def test_console_and_module_entrypoints_target_the_same_main()
- test_subcommands_and_arguments_parse_compatibly · function · L129-L132 — def test_subcommands_and_arguments_parse_compatibly(argv, expected)
- test_setup_only_accepts_each_documented_environment · function · L136-L138 — def test_setup_only_accepts_each_documented_environment(name)
- test_subcommand_help_advertises_supported_options · function · L160-L164 — def test_subcommand_help_advertises_supported_options(argv, expected_fragment, capsys)
- test_root_help_lists_every_supported_subcommand_through_python_m · function · L167-L213 — def test_root_help_lists_every_supported_subcommand_through_python_m()
- test_root_version_prints_the_declared_package_version · function · L216-L222 — def test_root_version_prints_the_declared_package_version(capsys)
- test_cli_rejects_unknown_commands_and_missing_run_task · function · L225-L230 — def test_cli_rejects_unknown_commands_and_missing_run_task(capsys)
- test_serve_rejects_invalid_ports · function · L234-L238 — def test_serve_rejects_invalid_ports(port, capsys)
- test_url_command_is_offline_and_returns_success · function · L241-L250 — def test_url_command_is_offline_and_returns_success(monkeypatch, capsys)
- _recorded_daemon_config · function · L253-L273 — def _recorded_daemon_config(tmp_path, *, host="172.25.100.5", port=9876, pid=4321)
- test_url_uses_the_live_recorded_endpoint_without_losing_url_semantics · function · L286-L300 — def test_url_uses_the_live_recorded_endpoint_without_losing_url_semantics( tmp_path, monkeypatch, capsys, recorded_host, url_host )
- test_url_ignores_a_recorded_endpoint_when_the_pid_is_not_live · function · L303-L313 — def test_url_ignores_a_recorded_endpoint_when_the_pid_is_not_live( tmp_path, monkeypatch, capsys )
- test_recorded_endpoint_rejects_stale_or_invalid_state · function · L361-L373 — def test_recorded_endpoint_rejects_stale_or_invalid_state( tmp_path, monkeypatch, payload )
- _darwin_kinfo_record · function · L379-L385 — def _darwin_kinfo_record(*, seconds=1_789_000_000, micros=123_456, p_stat=2)
- _as_darwin · function · L388-L396 — def _as_darwin(module, monkeypatch, record)
- test_a_darwin_start_token_is_the_process_start_time · function · L399-L409 — def test_a_darwin_start_token_is_the_process_start_time(monkeypatch)
- _live_darwin_daemon · function · L412-L432 — def _live_darwin_daemon(tmp_path, *, port=9734)
- test_url_on_macos_names_the_port_the_daemon_was_started_on · function · L435-L447 — def test_url_on_macos_names_the_port_the_daemon_was_started_on( tmp_path, monkeypatch, capsys )
- test_status_on_macos_probes_the_port_the_daemon_was_started_on · function · L450-L480 — def test_status_on_macos_probes_the_port_the_daemon_was_started_on( tmp_path, monkeypatch, capsys )
- Response · class · L459-L468 — class Response
- enter · method · L460-L461 — def enter(self)
- exit · method · L463-L464 — def exit(self, *_args)
- read · method · L467-L468 — def read()
- open_daemon · function · L470-L474 — def open_daemon(request, *, timeout)
- test_a_reused_pid_on_macos_still_falls_back_to_the_callers_config · function · L483-L495 — def test_a_reused_pid_on_macos_still_falls_back_to_the_callers_config( tmp_path, monkeypatch, capsys )
- test_the_darwin_start_token_is_read_from_the_real_kernel · function · L499-L513 — def test_the_darwin_start_token_is_read_from_the_real_kernel()
- test_stage1_run_allows_control_only_agent_before_any_readiness_probe · function · L516-L566 — def test_stage1_run_allows_control_only_agent_before_any_readiness_probe( tmp_path, monkeypatch, capsys )
- Agent · class · L530-L543 — class Agent
- init · method · L531-L532 — def init(self, *, cfg, verbose, task_mode=None)
- run · method · L534-L543 — def run(self, task)
- forbidden_readiness · function · L545-L546 — def forbidden_readiness(**_kwargs)
- test_stage1_run_projects_typed_first_cell_readiness_refusal · function · L569-L613 — def test_stage1_run_projects_typed_first_cell_readiness_refusal( tmp_path, monkeypatch, capsys )
- Agent · class · L593-L599 — class Agent
- init · method · L594-L595 — def init(self, *, cfg, verbose, task_mode=None)
- run · method · L597-L599 — def run(self, task)
- test_flag_off_run_preserves_agent_execution_without_readiness_probe · function · L616-L657 — def test_flag_off_run_preserves_agent_execution_without_readiness_probe( tmp_path, monkeypatch, capsys )
- Agent · class · L629-L639 — class Agent
- init · method · L630-L631 — def init(self, *, cfg, verbose, task_mode=None)
- run · method · L633-L639 — def run(self, task)
- forbidden_readiness · function · L641-L642 — def forbidden_readiness(**_kwargs)
- test_run_that_did_not_complete_exits_non_zero_with_its_result_intact · function · L664-L709 — def test_run_that_did_not_complete_exits_non_zero_with_its_result_intact( tmp_path, monkeypatch, capsys, stop_reason, as_json )
- Agent · class · L684-L694 — class Agent
- init · method · L685-L686 — def init(self, *, cfg, verbose, task_mode=None)
- run · method · L688-L694 — def run(self, task)
- _scripted_cli_run · function · L712-L737 — def _scripted_cli_run(tmp_path, monkeypatch, replies, *, max_turns)
- chat · function · L725-L733 — def chat(messages, cfg, **kwargs)
- _only_frame_row · function · L740-L748 — def _only_frame_row(cfg)
- test_real_cli_run_hitting_max_turns_exits_3_and_closes_its_frame_failed · function · L751-L762 — def test_real_cli_run_hitting_max_turns_exits_3_and_closes_its_frame_failed( tmp_path, monkeypatch, capsys )
- test_real_cli_run_that_submits_exits_0_and_closes_its_frame_done · function · L765-L779 — def test_real_cli_run_that_submits_exits_0_and_closes_its_frame_done( tmp_path, monkeypatch, capsys )
- test_a_blank_task_is_refused_before_any_config_store_or_model_call · function · L784-L816 — def test_a_blank_task_is_refused_before_any_config_store_or_model_call( tmp_path, monkeypatch, capsys, task, as_json )
- test_run_help_documents_the_exit_status_table · function · L819-L830 — def test_run_help_documents_the_exit_status_table(capsys)
- _run_refusal_codes · function · L833-L840 — def _run_refusal_codes() -> list[str]
- test_every_exit_2_refusal_code_is_in_the_documented_exit_table · function · L843-L901 — def test_every_exit_2_refusal_code_is_in_the_documented_exit_table(capsys)
- test_the_cli_readme_halves_carry_the_same_operational_contract · function · L904-L922 — def test_the_cli_readme_halves_carry_the_same_operational_contract()
- contract_bullets · function · L911-L914 — def contract_bullets(name: str, heading: str) -> list[str]
- test_the_upgrade_guide_names_the_longer_stop_wait · function · L925-L954 — def test_the_upgrade_guide_names_the_longer_stop_wait()
- test_daemon_health_ignores_environment_proxies_for_a_wsl_nat_host · function · L957-L997 — def test_daemon_health_ignores_environment_proxies_for_a_wsl_nat_host(monkeypatch)
- Response · class · L963-L974 — class Response
- enter · method · L966-L967 — def enter(self)
- exit · method · L969-L970 — def exit(self, *_args)
- read · method · L973-L974 — def read()
- Opener · class · L976-L980 — class Opener
- open · method · L978-L980 — def open(request, timeout)
- build_opener · function · L982-L984 — def build_opener(*items)
- test_detached_serve_starts_the_foreground_command_in_a_new_session · function · L1000-L1042 — def test_detached_serve_starts_the_foreground_command_in_a_new_session( tmp_path, monkeypatch, capsys )
- Process · class · L1020-L1025 — class Process
- poll · method · L1024-L1025 — def poll()
- fake_popen · function · L1027-L1031 — def fake_popen(command, **kwargs)
- test_detached_serve_stops_a_child_that_never_becomes_ready · function · L1045-L1087 — def test_detached_serve_stops_a_child_that_never_becomes_ready( tmp_path, monkeypatch, capsys )
- Process · class · L1065-L1079 — class Process
- poll · method · L1069-L1070 — def poll()
- terminate · method · L1073-L1074 — def terminate()
- wait · method · L1077-L1079 — def wait(timeout)
- test_detached_serve_ready_timeout_is_overridable · function · L1090-L1130 — def test_detached_serve_ready_timeout_is_overridable(tmp_path, monkeypatch, capsys)
- Process · class · L1107-L1120 — class Process
- poll · method · L1111-L1112 — def poll()
- terminate · method · L1115-L1116 — def terminate()
- wait · method · L1119-L1120 — def wait(timeout)
- test_detached_serve_does_not_accept_an_unrelated_healthy_daemon · function · L1133-L1173 — def test_detached_serve_does_not_accept_an_unrelated_healthy_daemon( tmp_path, monkeypatch, capsys )
- Process · class · L1153-L1162 — class Process
- poll · method · L1157-L1158 — def poll()
- terminate · method · L1161-L1162 — def terminate()
- test_detached_cleanup_escalates_to_kill_and_reaps · function · L1176-L1202 — def test_detached_cleanup_escalates_to_kill_and_reaps()
- Process · class · L1180-L1198 — class Process
- poll · method · L1182-L1183 — def poll()
- terminate · method · L1186-L1187 — def terminate()
- kill · method · L1190-L1191 — def kill()
- wait · method · L1194-L1198 — def wait(timeout)
- test_detached_cleanup_does_not_signal_an_already_exited_child · function · L1205-L1217 — def test_detached_cleanup_does_not_signal_an_already_exited_child()
- Process · class · L1208-L1215 — class Process
- poll · method · L1210-L1211 — def poll()
- terminate · method · L1214-L1215 — def terminate()
- test_status_reports_the_local_data_dir_without_trusting_health · function · L1220-L1251 — def test_status_reports_the_local_data_dir_without_trusting_health(monkeypatch, capsys)
- Response · class · L1228-L1236 — class Response
- enter · method · L1229-L1230 — def enter(self)
- exit · method · L1232-L1233 — def exit(self, *args)
- read · method · L1235-L1236 — def read(self)
- test_status_probes_and_reports_the_live_recorded_endpoint · function · L1254-L1285 — def test_status_probes_and_reports_the_live_recorded_endpoint( tmp_path, monkeypatch, capsys )
- Response · class · L1261-L1270 — class Response
- enter · method · L1262-L1263 — def enter(self)
- exit · method · L1265-L1266 — def exit(self, *_args)
- read · method · L1269-L1270 — def read()
- open_daemon · function · L1272-L1274 — def open_daemon(request, *, timeout)
- test_status_never_prints_the_access_token_and_points_at_url · function · L1288-L1329 — def test_status_never_prints_the_access_token_and_points_at_url( tmp_path, monkeypatch, capsys )
- Response · class · L1304-L1313 — class Response
- enter · method · L1305-L1306 — def enter(self)
- exit · method · L1308-L1309 — def exit(self, *_args)
- read · method · L1312-L1313 — def read()
- test_ctrl_c_during_a_run_stops_this_agent_s_cell_and_still_exits · function · L1333-L1360 — def test_ctrl_c_during_a_run_stops_this_agent_s_cell_and_still_exits()
- test_ctrl_c_exits_even_when_the_cell_cannot_be_interrupted · function · L1374-L1388 — def test_ctrl_c_exits_even_when_the_cell_cannot_be_interrupted(interrupt_foreground)
- test_serve_future_schema_fails_before_directories_singleton_or_spawn · function · L1392-L1419 — def test_serve_future_schema_fails_before_directories_singleton_or_spawn( tmp_path, monkeypatch, capsys, detached )
- test_serve_formal_open_future_schema_error_clears_only_owned_state · function · L1422-L1443 — def test_serve_formal_open_future_schema_error_clears_only_owned_state( tmp_path, monkeypatch, capsys )
- reject · function · L1437-L1438 — def reject(_cfg)
- _older_store_whose_upgrade_fails · function · L1446-L1464 — def _older_store_whose_upgrade_fails(data_dir, monkeypatch)
- fail · function · L1460-L1461 — def fail(_self, _connection)
- test_serve_reports_a_failed_upgrade_in_one_line_naming_the_backup · function · L1467-L1497 — def test_serve_reports_a_failed_upgrade_in_one_line_naming_the_backup( tmp_path, monkeypatch, capsys )
- test_run_reports_a_failed_upgrade_in_one_line_naming_the_backup · function · L1500-L1517 — def test_run_reports_a_failed_upgrade_in_one_line_naming_the_backup( tmp_path, monkeypatch, capsys )
- test_detached_child_future_schema_is_reported_without_startup_timeout · function · L1520-L1550 — def test_detached_child_future_schema_is_reported_without_startup_timeout( tmp_path, monkeypatch, capsys )
- Process · class · L1532-L1536 — class Process
- poll · method · L1535-L1536 — def poll(self)
- spawn · function · L1538-L1543 — def spawn(_command, **kwargs)
- test_real_detached_child_rejects_future_schema_with_explicit_parent_error · function · L1554-L1576 — def test_real_detached_child_rejects_future_schema_with_explicit_parent_error( tmp_path, monkeypatch, capsys )
- _detached_child_that_exits · function · L1579-L1596 — def _detached_child_that_exits(module, monkeypatch, *, output: str, status: int)
- Process · class · L1582-L1589 — class Process
- poll · method · L1585-L1586 — def poll(self)
- terminate · method · L1588-L1589 — def terminate(self)
- spawn · function · L1591-L1593 — def spawn(_command, **kwargs)
- test_detached_child_failed_upgrade_is_reported_in_one_line_naming_the_backup · function · L1599-L1641 — def test_detached_child_failed_upgrade_is_reported_in_one_line_naming_the_backup( tmp_path, monkeypatch, capsys )
- test_detached_child_failed_upgrade_names_no_backup_that_does_not_exist · function · L1644-L1667 — def test_detached_child_failed_upgrade_names_no_backup_that_does_not_exist( tmp_path, monkeypatch, capsys )
- test_detached_child_that_cannot_bind_is_reported_with_its_own_line · function · L1670-L1689 — def test_detached_child_that_cannot_bind_is_reported_with_its_own_line( tmp_path, monkeypatch, capsys )
- test_detached_child_that_exits_early_is_not_reported_as_a_timeout · function · L1693-L1713 — def test_detached_child_that_exits_early_is_not_reported_as_a_timeout( tmp_path, monkeypatch, capsys, status, expected )
- _free_port · function · L1716-L1721 — def _free_port() -> int
- _v31_database_whose_upgrade_fails_in_any_process · function · L1724-L1737 — def _v31_database_whose_upgrade_fails_in_any_process(db_path: Path) -> None
- test_real_detached_child_failed_upgrade_names_the_backup_and_exits_2 · function · L1741-L1769 — def test_real_detached_child_failed_upgrade_names_the_backup_and_exits_2( tmp_path, monkeypatch, capsys )
- test_a_future_schema_refusal_prints_its_code_under_json · function · L1780-L1810 — def test_a_future_schema_refusal_prints_its_code_under_json( tmp_path, monkeypatch, capsys, argv )
- test_a_failed_upgrade_refusal_prints_its_code_under_json · function · L1813-L1831 — def test_a_failed_upgrade_refusal_prints_its_code_under_json( tmp_path, monkeypatch, capsys )
- test_a_store_refusal_without_json_prints_nothing_on_stdout · function · L1834-L1848 — def test_a_store_refusal_without_json_prints_nothing_on_stdout( tmp_path, monkeypatch, capsys )
- test_store_opening_commands_refuse_a_future_schema_without_a_traceback · function · L1854-L1875 — def test_store_opening_commands_refuse_a_future_schema_without_a_traceback( tmp_path, monkeypatch, capsys, argv )