100% test coverage

This commit is contained in:
Andrew Herrington
2021-12-10 18:18:06 -06:00
parent 2bfece1e56
commit 95ab6d45f2
2 changed files with 14 additions and 2 deletions

View File

@@ -44,12 +44,14 @@ class AbstractClient(ABC):
self._finalizer = finalize(self, self._finalizer_method) self._finalizer = finalize(self, self._finalizer_method)
@abstractmethod @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.""" """Finalizer method is called by weakref.finalize when the object is dereferenced to do cleanup of clients."""
pass pass
@abstractmethod @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.""" """Calls the API's /checks/ endpoint to get a list of checks."""
pass pass

View 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"