Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabello committed Sep 19, 2023
1 parent f9ec5f0 commit cb3f376
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ def _external_url(self) -> str:
If not set in the config, return the internal url.
"""
# Note: this property is here for convenience, and for semantic reasons.
# When the charm will have a traefik relation, the `_external_url` should
# return `self.ingress.url or self._internal_url`.
return self.ingress.url or self._internal_url

@property
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TestWithInitialHooks(unittest.TestCase):

@patch.object(BlackboxExporterApi, "reload", tautology)
@patch("socket.getfqdn", new=lambda *args: "fqdn")
@patch("charm.BlackboxExporterCharm._external_url", new="http://0.0.0.0/")
@k8s_resource_multipatch
@patch("lightkube.core.client.GenericSyncClient")
@patch.object(WorkloadManager, "_blackbox_exporter_version", property(lambda *_: "0.0.0"))
Expand Down Expand Up @@ -71,6 +72,7 @@ class TestWithoutInitialHooks(unittest.TestCase):
@patch.object(BlackboxExporterApi, "reload", tautology)
@k8s_resource_multipatch
@patch("lightkube.core.client.GenericSyncClient")
@patch("charm.BlackboxExporterCharm._external_url", new="http://0.0.0.0/")
def setUp(self, *unused):
self.harness = Harness(BlackboxExporterCharm)
self.addCleanup(self.harness.cleanup)
Expand Down

0 comments on commit cb3f376

Please sign in to comment.