def test_calibration_model_clear_rayleigh_region():
    cm = CalibrationModel()
    cm.add_rayleigh_region(0, [0.9, 3])

    rayleigh_region_0 = cm.get_rayleigh_regions(0)

    assert rayleigh_region_0 == [(1, 3)]

    cm.clear_rayleigh_regions(0)
    rayleigh_region_0 = cm.get_rayleigh_regions(0)

    assert rayleigh_region_0 == []
def test_calibration_model_add_rayleigh_region():
    cm = CalibrationModel()

    rayleigh_region = cm.get_rayleigh_regions(0)
    assert rayleigh_region == []

    cm.add_rayleigh_region(0, [0.9, 3])
    cm.add_rayleigh_region(0, (2, 5))

    rayleigh_region_0 = cm.get_rayleigh_regions(0)

    assert rayleigh_region_0 == [(1, 5)]

    cm.add_rayleigh_region(0, (7, 9))

    assert rayleigh_region_0 == [(1, 5), (7, 9)]

    cm.add_rayleigh_region(0, (2, 3))

    assert rayleigh_region_0 == [(1, 5), (7, 9)]
def test_calibration_model_set_rayleigh_region():
    cm = CalibrationModel()
    cm.add_rayleigh_region(0, [0.9, 3])

    rayleigh_region_0 = cm.get_rayleigh_regions(0)

    assert rayleigh_region_0 == [(1, 3)]

    cm.set_rayleigh_region(0, 0, (2, 5))

    assert rayleigh_region_0 == [(2, 5)]

    cm.set_rayleigh_region(0, 1, (4, 7))

    assert rayleigh_region_0 == [(2, 5), (4, 7)]

    cm.set_rayleigh_region(0, 3, (8, 9))

    assert rayleigh_region_0 == [(2, 5), (4, 7), (8, 9)]