From f26bf0db1dfc93fafa344977bd999a334a55cd36 Mon Sep 17 00:00:00 2001 From: halcy Date: Sat, 19 Nov 2022 01:59:17 +0200 Subject: Add policy param for push_subscription_set --- tests/test_push.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/test_push.py') diff --git a/tests/test_push.py b/tests/test_push.py index 0479191..daa99c7 100644 --- a/tests/test_push.py +++ b/tests/test_push.py @@ -26,11 +26,18 @@ def test_decrypt(api): @pytest.mark.vcr(match_on=['path']) def test_push_set(api): priv, pub = api.push_subscription_generate_keys() - sub = api.push_subscription_set("example.com", pub) - + sub = api.push_subscription_set("example.com", pub, follow_events=True, favourite_events=True, reblog_events=True, mention_events=True, poll_events=True, follow_request_events=True, status_events=True, policy='none') assert sub == api.push_subscription() assert sub.endpoint == "https://example.com" + should_throw = False + try: + sub = api.push_subscription_set("example.com", pub, follow_events=True, favourite_events=True, reblog_events=True, mention_events=True, poll_events=True, follow_request_events=True, status_events=True, policy='not a valid value') + should_throw = True + except: + pass + assert not should_throw + @pytest.mark.vcr(match_on=['path']) def test_push_update(api): priv, pub = api.push_subscription_generate_keys() -- cgit v1.2.3