Skip to content

Commit

Permalink
Responded to comments - correct fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
lizsalmon committed Jan 6, 2025
1 parent 85ff405 commit d51cddc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/sensors/test_hypervisor_state_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

@pytest.fixture(name="sensor")
def state_sensor_fixture():
sensor_service = MagicMock()
config = {"hypervisor_sensor": {"cloud_account": "dev", "uptime_limit": 180}}
poll_interval = 10
sensor = HypervisorStateSensor(sensor_service, config, poll_interval)
sensor.sensor_service = sensor_service # So that I dont need two fixtures?
return sensor
return HypervisorStateSensor(
sensor_service=MagicMock(),
config={"hypervisor_sensor": {"cloud_account": "dev", "uptime_limit": 180}},
poll_interval=10,
)


@patch("sensors.src.hypervisor_state_sensor.get_hypervisor_state")
Expand All @@ -20,7 +19,6 @@ def test_poll(mock_query_hypervisor_state, mock_get_hypervisor_state, sensor):
"""
Test main function of sensor, polling state of hypervisor state
"""
sensor.sensor_service = MagicMock()
mock_query_hypervisor_state.return_value = [
{
"hypervisor_name": "hv1",
Expand Down

0 comments on commit d51cddc

Please sign in to comment.