diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-11-19 01:59:17 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-11-19 01:59:17 +0200 |
commit | f26bf0db1dfc93fafa344977bd999a334a55cd36 (patch) | |
tree | 02275636a092ccc66c67b3d9124c9f82ac613661 /tests/test_push.py | |
parent | d992b9bb8c687c4ae6bff545edd303c6b58d4124 (diff) | |
download | mastodon.py-f26bf0db1dfc93fafa344977bd999a334a55cd36.tar.gz |
Add policy param for push_subscription_set
Diffstat (limited to 'tests/test_push.py')
-rw-r--r-- | tests/test_push.py | 11 |
1 files changed, 9 insertions, 2 deletions
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): | |||
26 | @pytest.mark.vcr(match_on=['path']) | 26 | @pytest.mark.vcr(match_on=['path']) |
27 | def test_push_set(api): | 27 | def test_push_set(api): |
28 | priv, pub = api.push_subscription_generate_keys() | 28 | priv, pub = api.push_subscription_generate_keys() |
29 | sub = api.push_subscription_set("example.com", pub) | 29 | 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') |
30 | |||
31 | assert sub == api.push_subscription() | 30 | assert sub == api.push_subscription() |
32 | assert sub.endpoint == "https://example.com" | 31 | assert sub.endpoint == "https://example.com" |
33 | 32 | ||
33 | should_throw = False | ||
34 | try: | ||
35 | 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') | ||
36 | should_throw = True | ||
37 | except: | ||
38 | pass | ||
39 | assert not should_throw | ||
40 | |||
34 | @pytest.mark.vcr(match_on=['path']) | 41 | @pytest.mark.vcr(match_on=['path']) |
35 | def test_push_update(api): | 42 | def test_push_update(api): |
36 | priv, pub = api.push_subscription_generate_keys() | 43 | priv, pub = api.push_subscription_generate_keys() |