mirror of
https://github.com/andrewthetechie/py-healthchecks.io.git
synced 2026-04-17 12:35:35 +02:00
100% test coverage
This commit is contained in:
@@ -44,12 +44,14 @@ class AbstractClient(ABC):
|
||||
self._finalizer = finalize(self, self._finalizer_method)
|
||||
|
||||
@abstractmethod
|
||||
def _finalizer_method(self):
|
||||
def _finalizer_method(self): # pragma: no cover
|
||||
"""Finalizer method is called by weakref.finalize when the object is dereferenced to do cleanup of clients."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def get_checks(self, tags: Optional[List[str]]) -> List[checks.Check]:
|
||||
def get_checks(
|
||||
self, tags: Optional[List[str]]
|
||||
) -> List[checks.Check]: # pragma: no cover
|
||||
"""Calls the API's /checks/ endpoint to get a list of checks."""
|
||||
pass
|
||||
|
||||
|
||||
10
tests/client/test_abstract.py
Normal file
10
tests/client/test_abstract.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from healthchecks_io.client._abstract import AbstractClient
|
||||
|
||||
|
||||
def test_abstract_add_url_params():
|
||||
AbstractClient.__abstractmethods__ = set()
|
||||
abstract_client = AbstractClient("test")
|
||||
url = abstract_client._add_url_params(
|
||||
"http://test.com/?test=test", {"test": "test2"}
|
||||
)
|
||||
assert url == "http://test.com/?test=test2"
|
||||
Reference in New Issue
Block a user