mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-31 01:29:28 +01:00
71b65342b9
* added basic recap feature (no error handling) * introduced abstractpublication * extracted base reports * added error report to recap * added test * added docs * implemented publisher and formatter * fixed API for recap * removed redundant config validation * added config sample * added active publisher test
19 lines
720 B
Python
19 lines
720 B
Python
from mobilizon_reshare.config.config import get_settings
|
|
from mobilizon_reshare.config.publishers import publisher_name_to_validators
|
|
from mobilizon_reshare.publishers import get_active_publishers
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"active_publishers", [["telegram"], ["zulip"], ["telegram", "zulip"]]
|
|
)
|
|
def test_active_publishers(active_publishers):
|
|
|
|
for publisher in publisher_name_to_validators:
|
|
# if the publisher is in the active_publisher param, I set it to True, otherwise False
|
|
get_settings().update(
|
|
{f"publisher.{publisher}.active": (publisher in active_publishers)}
|
|
)
|
|
publishers = list(get_active_publishers())
|
|
assert publishers == active_publishers
|