From e7316d177f9e933f29126f1ab03997e9cb66e0e1 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Mon, 27 Apr 2026 16:10:15 -0700 Subject: [PATCH] feat: register BlogPostStrategy in platform registry --- app/services/platforms/__init__.py | 3 ++- tests/services/platforms/test_registry.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/services/platforms/__init__.py b/app/services/platforms/__init__.py index d9ae1d3..4f237b5 100644 --- a/app/services/platforms/__init__.py +++ b/app/services/platforms/__init__.py @@ -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, ] } diff --git a/tests/services/platforms/test_registry.py b/tests/services/platforms/test_registry.py index 5a877d6..3a17cae 100644 --- a/tests/services/platforms/test_registry.py +++ b/tests/services/platforms/test_registry.py @@ -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