tests.test_config module¶
Tests for the [tool.repomatic] schema and its loader.
- tests.test_config.test_default_locations_target_claude_code()[source]¶
Skills, subagents and settings land where Claude Code reads them.
- tests.test_config.test_is_enabled_reads_the_key_the_user_writes(key, value, expected)[source]¶
Every shape of
[tool.repomatic]key reaches the field that stores it.
- tests.test_config.test_is_enabled_rejects_a_key_with_no_field(key)[source]¶
A gate wired to a missing key raises instead of reading as switched off.
- tests.test_config.test_config_key_paths_cover_every_reference_row()[source]¶
The gate map and the reference table agree on the set of keys.
- tests.test_config.test_removed_keys_warn_as_unknown(table, caplog)[source]¶
A key
8.0.0removed is an unknown key, reported rather than fatal.
- tests.test_config.TWO_WEEKS_COOLDOWN = '[tool.repomatic]\nminimum-release-age = "2 weeks"\n'¶
A
pyproject.tomlwhose cooldown differs from the default one.
- tests.test_config.test_published_config_wins_over_the_working_directory(tmp_path, monkeypatch)[source]¶
A published config answers every no-argument load, whatever the file says.
The CLI resolves its configuration through click-extra (an upward search, the user folder,
--config), and a library helper reading./pyproject.tomlalone would disagree with it.
- tests.test_config.test_published_config_leaves_another_project_alone(tmp_path, monkeypatch)[source]¶
A project other than the working directory still reads its own file.
- tests.test_config.test_config_holds_plain_data(tmp_path, monkeypatch)[source]¶
A config read from the cached
tomlrtdocument holds notomlrtobject.The document stays shared and keeps its formatting trivia, so the config built from it gets plain copies.
- tests.test_config.test_load_repomatic_config_defaults(tmp_path, monkeypatch)[source]¶
Test that load_repomatic_config returns a Config instance with defaults.
- tests.test_config.test_load_repomatic_config_custom_values(tmp_path, monkeypatch)[source]¶
Test that load_repomatic_config reads custom values from pyproject.toml.
- tests.test_config.test_load_repomatic_config_with_preloaded_data()[source]¶
Test that load_repomatic_config accepts pre-parsed pyproject data.
- tests.test_config.test_site_deploy_accepts_every_implemented_target(target)[source]¶
Each target names a deploy job in
docs.yaml, so each must load.
- tests.test_config.test_site_deploy_rejects_a_target_with_no_job_behind_it()[source]¶
An unimplemented target would publish nowhere, from a green workflow.
The
docs.yamljobs gate on equality with a known value, so a typo or a host nobody wired up simply matches neither, and the run reports success having deployed nothing at all.
- tests.test_config.test_site_cloudflare_settings_load_from_their_table()[source]¶
The drift-check declarations ride the same
site.*table.
- tests.test_config.test_site_cloudflare_placement_rejects_unknown_modes()[source]¶
A bad placement mode must die here, not in a Cloudflare PATCH response.
The value is written verbatim to the live project by cloudflare-pages –apply, so the API rejection would surface far from the
pyproject.tomlline that caused it.
- tests.test_config.test_site_cloudflare_r2_keys_come_as_a_pair(site)[source]¶
A bucket and its host are declared together, or the loader refuses.
A bucket with nowhere to redirect, or a host with nothing to upload to, would only fail at the first oversized file, deep in a deploy.
- tests.test_config.test_site_cloudflare_r2_domain_must_be_a_bare_hostname()[source]¶
The offload writes
https://{domain}/{key}: a scheme would double.
- tests.test_config.test_lint_repo_declined_keeps_its_keys_verbatim()[source]¶
A declined entry is named by a tool’s own keys, so none may be rewritten.
Key normalization would turn
extend-selectintoextend_select, which names no key of[tool.ruff]: the entry would then decline nothing.
- tests.test_config.test_lint_repo_declined_entries_keep_what_is_not_a_reason(declined, expected)[source]¶
A leaf holding no reason stays in the answer, for
lint-repoto report.
- tests.test_config.test_load_repomatic_config_warns_unknown_keys(tmp_path, monkeypatch, caplog)[source]¶
Unknown keys in [tool.repomatic] produce a warning, not an error.
- tests.test_config.test_load_repomatic_config_warns_unknown_keys_once(tmp_path, monkeypatch, caplog)[source]¶
Re-loading the same project reports its unknown keys only once.
Every helper needing a setting re-loads the config, so without the per-project dedup a single stale key floods each invocation’s output.
- tests.test_config.test_config_reference()[source]¶
Config reference table covers all Config fields with descriptions.
- tests.test_config.test_show_config_type_cell(annotation, expected)[source]¶
A nested generic escapes its outer brackets, and
| Noneis dropped.