AI Implementation feature(1084): Blog Repository Clone and Pull Workflow (#3)
This commit was merged in pull request #3.
This commit is contained in:
@@ -35,6 +35,35 @@ def test_load_config_succeeds_with_complete_env(env_setup) -> None:
|
||||
assert config.visibility == "public"
|
||||
|
||||
|
||||
def test_load_config_blog_defaults(env_setup) -> None:
|
||||
config = load_config()
|
||||
assert config.blog_repo_url == "https://git.chaospott.de/Chaospott/site"
|
||||
assert config.blog_dir.name == "blog"
|
||||
|
||||
|
||||
def test_load_config_blog_repo_url_override(env_setup, monkeypatch) -> None:
|
||||
monkeypatch.setenv("BLOG_REPO_URL", "https://example.com/repo.git")
|
||||
config = load_config()
|
||||
assert config.blog_repo_url == "https://example.com/repo.git"
|
||||
|
||||
|
||||
def test_validate_config_rejects_bad_blog_repo_url(env_setup) -> None:
|
||||
values = {
|
||||
"MASTODON_BASE_URL": "https://mastodon.example",
|
||||
"MASTODON_ACCESS_TOKEN": "x",
|
||||
"VISIBILITY": "public",
|
||||
"SITE_URL": "https://blog.example.com",
|
||||
"HASHTAGS": "#throwback",
|
||||
"THROWNBACK_PREFIX": "Throwback:",
|
||||
"MAX_RETRIES": "3",
|
||||
"RUN_AT": "09:00",
|
||||
"TZ": "Europe/Berlin",
|
||||
"BLOG_REPO_URL": "ftp://bad",
|
||||
}
|
||||
with pytest.raises(ConfigError, match="BLOG_REPO_URL"):
|
||||
validate_config(values)
|
||||
|
||||
|
||||
def test_validate_config_lists_every_missing_key(env_setup, monkeypatch) -> None:
|
||||
monkeypatch.delenv("MASTODON_ACCESS_TOKEN")
|
||||
monkeypatch.delenv("SITE_URL")
|
||||
|
||||
Reference in New Issue
Block a user