forked from genewildish/Mainline
fix: update ntfy tests for SSE API (reconnect_delay)
This commit is contained in:
@@ -16,7 +16,7 @@ import json
|
|||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from urllib.parse import urlparse, parse_qs, urlencode, urlunparse
|
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
|
||||||
|
|
||||||
|
|
||||||
class NtfyPoller:
|
class NtfyPoller:
|
||||||
|
|||||||
@@ -15,15 +15,15 @@ class TestNtfyPollerInit:
|
|||||||
"""Default values are set correctly."""
|
"""Default values are set correctly."""
|
||||||
poller = NtfyPoller("http://example.com/topic")
|
poller = NtfyPoller("http://example.com/topic")
|
||||||
assert poller.topic_url == "http://example.com/topic"
|
assert poller.topic_url == "http://example.com/topic"
|
||||||
assert poller.poll_interval == 15
|
assert poller.reconnect_delay == 5
|
||||||
assert poller.display_secs == 30
|
assert poller.display_secs == 30
|
||||||
|
|
||||||
def test_init_custom_values(self):
|
def test_init_custom_values(self):
|
||||||
"""Custom values are set correctly."""
|
"""Custom values are set correctly."""
|
||||||
poller = NtfyPoller(
|
poller = NtfyPoller(
|
||||||
"http://example.com/topic", poll_interval=5, display_secs=60
|
"http://example.com/topic", reconnect_delay=10, display_secs=60
|
||||||
)
|
)
|
||||||
assert poller.poll_interval == 5
|
assert poller.reconnect_delay == 10
|
||||||
assert poller.display_secs == 60
|
assert poller.display_secs == 60
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user