blob: 9fce9395cb37c2dfe77d44127ca3f58ddb2e5b4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import requests
from requests.exceptions import ConnectionError
class TalerService:
def __init__(self, config, watcher_getter, request):
self.config = config
self.watcher_getter = watcher_getter
self.request = request
def test_url(self):
try:
requests.get(self.url, timeout=3)
except ConnectionError as e:
return False
else:
return True
|