def test_units(observation):
    ps = PowerSpectrum(observation=observation)

    assert ps.horizon_buffer.to("littleh/Mpc").unit == units.littleh / units.Mpc
    assert ps.k_21.to("littleh/Mpc").unit == units.littleh / units.Mpc
    assert ps.delta_21.to("mK^2").unit == units.mK**2
    assert callable(ps.p21)
    assert ps.k_min.to("littleh/Mpc").unit == units.littleh / units.Mpc
    assert ps.k_max.to("littleh/Mpc").unit == units.littleh / units.Mpc
    assert ps.k1d.to("littleh/Mpc").unit == units.littleh / units.Mpc
    assert isinstance(ps.power_normalisation(0.1 * units.littleh / units.Mpc), float)
    assert ps.horizon_limit(10).to("littleh/Mpc").unit == units.littleh / units.Mpc

    ps = PowerSpectrum(
        observation=observation,
        k_21=np.array([1, 2, 3]) * units.littleh / units.Mpc,
        delta_21=np.array([1, 2, 3]) * units.mK**2,
    )
    ps2 = PowerSpectrum(
        observation=observation,
        k_21=np.array([1, 2, 3]) / units.Mpc,
        delta_21=np.array([1, 2, 3]) * units.mK**2,
    )

    assert np.all(ps.k_21 < ps2.k_21)
def test_sensitivity_optimistic(observation):
    ps = PowerSpectrum(observation=observation, foreground_model="optimistic")
    assert ps.horizon_limit(10.0) > ps.horizon_limit(5.0)