republisher/tests/test_entrypoint.py

17 lines
502 B
Python

from types import SimpleNamespace
from repub.entrypoint import FeedNameFilter
def test_feed_name_filter_accepts_matching_item() -> None:
item = SimpleNamespace(feed_name="nasa")
feed_filter = FeedNameFilter({"feed_name": "nasa"})
assert feed_filter.accepts(item) is True
def test_feed_name_filter_rejects_non_matching_item() -> None:
item = SimpleNamespace(feed_name="gp-pod")
feed_filter = FeedNameFilter({"feed_name": "nasa"})
assert feed_filter.accepts(item) is False