fix telegram active (#78)

* 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
This commit is contained in:
Simone Robutti 2021-10-17 14:05:25 +02:00 committed by GitHub
parent c14cdfb67f
commit 71b65342b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
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