async def test_prepare_adaptation_data(
    hass_states_mock,
    service_data,
    split,
    filter_by_state,
    service_datas_expected,
    sleep_time_expected,
):
    """Test creation of correct service data objects."""
    data = prepare_adaptation_data(
        hass_states_mock,
        "test.entity",
        Context(id="test-id"),
        1,
        0.2,
        service_data,
        split,
        filter_by_state,
        force=False,
    )

    generated_service_datas = [item async for item in data.service_call_datas]

    assert data.entity_id == "test.entity"
    assert data.context.id == "test-id"
    assert data.sleep_time == sleep_time_expected
    assert generated_service_datas == service_datas_expected
Test creation of correct service data objects.
tests/test_adaptation_utils.py