feat: register BlogPostStrategy in platform registry
This commit is contained in:
parent
65fd09c06d
commit
e7316d177f
2 changed files with 12 additions and 1 deletions
|
|
@ -3,13 +3,14 @@ from __future__ import annotations
|
||||||
from app.services.platforms.base import PostingStrategy, PostResult
|
from app.services.platforms.base import PostingStrategy, PostResult
|
||||||
from app.services.platforms.reddit_post import RedditPostStrategy
|
from app.services.platforms.reddit_post import RedditPostStrategy
|
||||||
from app.services.platforms.reddit_comment import RedditCommentStrategy
|
from app.services.platforms.reddit_comment import RedditCommentStrategy
|
||||||
|
from app.services.platforms.blog_post import BlogPostStrategy
|
||||||
|
|
||||||
_REGISTRY: dict[str, PostingStrategy] = {
|
_REGISTRY: dict[str, PostingStrategy] = {
|
||||||
s.campaign_type: s()
|
s.campaign_type: s()
|
||||||
for s in [
|
for s in [
|
||||||
RedditPostStrategy,
|
RedditPostStrategy,
|
||||||
RedditCommentStrategy,
|
RedditCommentStrategy,
|
||||||
# BlogPostStrategy — added in Plan C
|
BlogPostStrategy,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import pytest
|
import pytest
|
||||||
from app.services.platforms import get_client, SUPPORTED_PLATFORMS
|
from app.services.platforms import get_client, SUPPORTED_PLATFORMS
|
||||||
from app.services.platforms.reddit_post import RedditPostStrategy
|
from app.services.platforms.reddit_post import RedditPostStrategy
|
||||||
|
from app.services.platforms.blog_post import BlogPostStrategy
|
||||||
|
|
||||||
|
|
||||||
def test_get_client_returns_reddit_post_strategy():
|
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():
|
def test_supported_platforms_contains_reddit_post():
|
||||||
assert "reddit_post" in SUPPORTED_PLATFORMS
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue