Skip to content

Commit

Permalink
test if setup calls waitforhealth
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Sep 11, 2024
1 parent 60d3828 commit 68f20ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/component/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class BaseComponentTestCase(ABC):
def setup_method(self) -> None:
config = {"Test Instance Name": self.CONFIG}
self.object = Factory.create(configuration=config)
self.object._wait_for_health = mock.MagicMock()
assert "metrics" not in self.object.__dict__, "metrics should be a cached_property"
self.metric_attributes = asdict(
self.object.metrics,
Expand Down Expand Up @@ -125,6 +126,10 @@ def test_setup_populates_cached_properties(self, mock_getmembers):
self.object.setup()
mock_getmembers.assert_called_with(self.object)

def test_setup_calls_wait_for_health(self):
self.object.setup()
self.object._wait_for_health.assert_called()

def test_config_is_immutable(self):
with pytest.raises(FrozenInstanceError):
self.object._config.type = "new_type"
Expand Down

0 comments on commit 68f20ec

Please sign in to comment.