← Về thư mục
tests/generate-image/test_scripts.py
- load_module · function · L19-L33 — def load_module()
- make_args · function · L39-L55 — def make_args(**overrides) -> argparse.Namespace
- CliSurfaceTests · class · L105-L171 — class CliSurfaceTests(unittest.TestCase)
- test_help_exits_zero · method · L106-L112 — def test_help_exits_zero(self)
- test_missing_prompt_is_an_error · method · L114-L120 — def test_missing_prompt_is_an_error(self)
- test_dry_run_prints_the_payload_without_network_or_key · method · L122-L131 — def test_dry_run_prints_the_payload_without_network_or_key(self)
- test_size_flag_is_gone · method · L133-L141 — def test_size_flag_is_gone(self)
- test_output_format_does_not_offer_svg · method · L143-L150 — def test_output_format_does_not_offer_svg(self)
- test_out_of_range_compression_is_rejected_locally · method · L152-L159 — def test_out_of_range_compression_is_rejected_locally(self)
- test_targets_the_images_endpoint_not_chat_completions · method · L161-L166 — def test_targets_the_images_endpoint_not_chat_completions(self)
- test_uses_only_the_standard_library · method · L168-L171 — def test_uses_only_the_standard_library(self)
- ApiKeyResolutionTests · class · L174-L225 — class ApiKeyResolutionTests(unittest.TestCase)
- test_explicit_key_wins · method · L175-L176 — def test_explicit_key_wins(self)
- test_environment_variable_is_read · method · L178-L187 — def test_environment_variable_is_read(self)
- test_dotenv_is_read_when_environment_is_empty · method · L189-L200 — def test_dotenv_is_read_when_environment_is_empty(self)
- test_dotenv_export_prefix_is_tolerated · method · L202-L213 — def test_dotenv_export_prefix_is_tolerated(self)
- test_absent_key_raises_with_guidance · method · L215-L225 — def test_absent_key_raises_with_guidance(self)
- PayloadTests · class · L228-L260 — class PayloadTests(unittest.TestCase)
- test_unset_parameters_are_omitted · method · L229-L231 — def test_unset_parameters_are_omitted(self)
- test_set_parameters_are_included · method · L233-L238 — def test_set_parameters_are_included(self)
- test_zero_seed_survives_omission_filtering · method · L240-L242 — def test_zero_seed_survives_omission_filtering(self)
- test_references_use_the_input_references_shape · method · L244-L249 — def test_references_use_the_input_references_shape(self)
- test_printed_payload_shortens_base64_references · method · L251-L260 — def test_printed_payload_shortens_base64_references(self)
- PreflightTests · class · L263-L327 — class PreflightTests(unittest.TestCase)
- test_valid_request_passes · method · L266-L268 — def test_valid_request_passes(self)
- test_unsupported_parameter_is_caught · method · L270-L274 — def test_unsupported_parameter_is_caught(self)
- test_value_outside_the_model_enum_is_caught · method · L276-L284 — def test_value_outside_the_model_enum_is_caught(self)
- test_n_above_the_model_maximum_is_caught · method · L286-L290 — def test_n_above_the_model_maximum_is_caught(self)
- test_too_many_reference_images_are_caught · method · L292-L299 — def test_too_many_reference_images_are_caught(self)
- test_every_problem_is_reported_at_once · method · L301-L305 — def test_every_problem_is_reported_at_once(self)
- test_unknown_model_suggests_close_matches · method · L307-L311 — def test_unknown_model_suggests_close_matches(self)
- test_suggestions_name_a_model_that_accepts_the_value · method · L313-L321 — def test_suggestions_name_a_model_that_accepts_the_value(self)
- test_suggestions_skip_undocumented_families · method · L323-L327 — def test_suggestions_skip_undocumented_families(self)
- SpecDescriptionTests · class · L330-L340 — class SpecDescriptionTests(unittest.TestCase)
- test_enum_lists_its_values · method · L331-L334 — def test_enum_lists_its_values(self)
- test_range_shows_its_bounds · method · L336-L337 — def test_range_shows_its_bounds(self)
- test_bare_capability_reads_as_supported · method · L339-L340 — def test_bare_capability_reads_as_supported(self)
- RetryTests · class · L343-L360 — class RetryTests(unittest.TestCase)
- test_retry_after_header_is_honoured · method · L344-L345 — def test_retry_after_header_is_honoured(self)
- test_absurd_retry_after_is_capped · method · L347-L348 — def test_absurd_retry_after_is_capped(self)
- test_unparsable_retry_after_falls_back_to_backoff · method · L350-L351 — def test_unparsable_retry_after_falls_back_to_backoff(self)
- test_backoff_grows · method · L353-L354 — def test_backoff_grows(self)
- test_only_transient_statuses_retry · method · L356-L360 — def test_only_transient_statuses_retry(self)
- ErrorMessageTests · class · L363-L375 — class ErrorMessageTests(unittest.TestCase)
- test_bad_request_points_at_model_info · method · L364-L367 — def test_bad_request_points_at_model_info(self)
- test_auth_failure_mentions_the_key_and_content_policy · method · L369-L372 — def test_auth_failure_mentions_the_key_and_content_policy(self)
- test_non_json_body_is_passed_through · method · L374-L375 — def test_non_json_body_is_passed_through(self)
- CostReportingTests · class · L378-L406 — class CostReportingTests(unittest.TestCase)
- test_reports_the_billed_cost · method · L379-L381 — def test_reports_the_billed_cost(self)
- test_byok_upstream_cost_is_not_reported_as_free · method · L383-L390 — def test_byok_upstream_cost_is_not_reported_as_free(self)
- test_genuinely_free_generation_says_so · method · L392-L393 — def test_genuinely_free_generation_says_so(self)
- test_image_tokens_are_reported_when_present · method · L395-L399 — def test_image_tokens_are_reported_when_present(self)
- test_missing_usage_reports_nothing · method · L401-L402 — def test_missing_usage_reports_nothing(self)
- test_cost_never_prints_in_scientific_notation · method · L404-L406 — def test_cost_never_prints_in_scientific_notation(self)
- ReferenceEncodingTests · class · L409-L439 — class ReferenceEncodingTests(unittest.TestCase)
- test_urls_and_data_urls_pass_through · method · L410-L412 — def test_urls_and_data_urls_pass_through(self)
- test_local_file_becomes_a_data_url · method · L414-L422 — def test_local_file_becomes_a_data_url(self)
- test_jpeg_extension_maps_to_jpeg_mime · method · L424-L428 — def test_jpeg_extension_maps_to_jpeg_mime(self)
- test_missing_file_raises · method · L430-L432 — def test_missing_file_raises(self)
- test_unsupported_extension_raises · method · L434-L439 — def test_unsupported_extension_raises(self)
- OutputPathTests · class · L442-L466 — class OutputPathTests(unittest.TestCase)
- test_default_name_follows_media_type · method · L443-L446 — def test_default_name_follows_media_type(self)
- test_unknown_media_type_falls_back_to_png · method · L448-L449 — def test_unknown_media_type_falls_back_to_png(self)
- test_media_type_parameters_are_ignored · method · L451-L453 — def test_media_type_parameters_are_ignored(self)
- test_explicit_output_is_respected · method · L455-L456 — def test_explicit_output_is_respected(self)
- test_multiple_images_are_numbered · method · L458-L462 — def test_multiple_images_are_numbered(self)
- test_jpeg_spelling_is_not_a_mismatch · method · L464-L466 — def test_jpeg_spelling_is_not_a_mismatch(self)
- SaveImageTests · class · L469-L514 — class SaveImageTests(unittest.TestCase)
- test_saves_base64_payload · method · L470-L477 — def test_saves_base64_payload(self)
- test_creates_missing_parent_directories · method · L479-L485 — def test_creates_missing_parent_directories(self)
- test_numbering_has_no_gaps_when_an_entry_is_empty · method · L487-L497 — def test_numbering_has_no_gaps_when_an_entry_is_empty(self)
- test_empty_data_raises · method · L499-L501 — def test_empty_data_raises(self)
- test_entries_without_any_image_data_raise · method · L503-L505 — def test_entries_without_any_image_data_raise(self)
- test_non_https_url_in_a_response_is_refused · method · L507-L511 — def test_non_https_url_in_a_response_is_refused(self)
- test_downloaded_images_are_size_capped · method · L513-L514 — def test_downloaded_images_are_size_capped(self)
- SkillDocumentTests · class · L517-L549 — class SkillDocumentTests(unittest.TestCase)
- test_frontmatter_version_matches_expected · method · L518-L520 — def test_frontmatter_version_matches_expected(self)
- test_documented_default_model_matches_the_script · method · L522-L524 — def test_documented_default_model_matches_the_script(self)
- test_reference_file_is_present · method · L526-L527 — def test_reference_file_is_present(self)
- test_documentation_does_not_promise_a_size_parameter · method · L529-L532 — def test_documentation_does_not_promise_a_size_parameter(self)
- test_transparent_background_is_not_offered_on_models_that_refuse_it · method · L534-L544 — def test_transparent_background_is_not_offered_on_models_that_refuse_it(self)
- test_text_and_integrity_caveats_are_documented · method · L546-L549 — def test_text_and_integrity_caveats_are_documented(self)