feat: register BlogPostStrategy in platform registry

This commit is contained in:
pyr0ball 2026-04-27 16:10:15 -07:00
parent 65fd09c06d
commit e7316d177f
2 changed files with 12 additions and 1 deletions

View file

@ -3,13 +3,14 @@ from __future__ import annotations
from app.services.platforms.base import PostingStrategy, PostResult
from app.services.platforms.reddit_post import RedditPostStrategy
from app.services.platforms.reddit_comment import RedditCommentStrategy
from app.services.platforms.blog_post import BlogPostStrategy
_REGISTRY: dict[str, PostingStrategy] = {
s.campaign_type: s()
for s in [
RedditPostStrategy,
RedditCommentStrategy,
# BlogPostStrategy — added in Plan C
BlogPostStrategy,
]
}

View file

@ -1,6 +1,7 @@
import pytest
from app.services.platforms import get_client, SUPPORTED_PLATFORMS
from app.services.platforms.reddit_post import RedditPostStrategy
from app.services.platforms.blog_post import BlogPostStrategy
def test_get_client_returns_reddit_post_strategy():
@ -15,3 +16,12 @@ def test_get_client_unknown_type_raises():
def test_supported_platforms_contains_reddit_post():
assert "reddit_post" in SUPPORTED_PLATFORMS
def test_get_client_returns_blog_post_strategy():
client = get_client("blog_post")
assert isinstance(client, BlogPostStrategy)
def test_supported_platforms_contains_blog_post():
assert "blog_post" in SUPPORTED_PLATFORMS