From 95ab6d45f27183b6a00a37b4d7c1692d321f96c8 Mon Sep 17 00:00:00 2001 From: Andrew Herrington Date: Fri, 10 Dec 2021 18:18:06 -0600 Subject: [PATCH] 100% test coverage --- src/healthchecks_io/client/_abstract.py | 6 ++++-- tests/client/test_abstract.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/client/test_abstract.py diff --git a/src/healthchecks_io/client/_abstract.py b/src/healthchecks_io/client/_abstract.py index 89ecd0a..f253c0a 100644 --- a/src/healthchecks_io/client/_abstract.py +++ b/src/healthchecks_io/client/_abstract.py @@ -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 diff --git a/tests/client/test_abstract.py b/tests/client/test_abstract.py new file mode 100644 index 0000000..7ba2318 --- /dev/null +++ b/tests/client/test_abstract.py @@ -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"