예제 #1
0
def test_histogram_is_needed(sam_reg_sys, needed):
    assert configuration.histogram_is_needed(*sam_reg_sys) is needed

    # non-supported systematic
    with pytest.raises(
        NotImplementedError, match="other systematics not yet implemented"
    ) as e_info:
        configuration.histogram_is_needed({}, {}, {"Type": "unknown"})
예제 #2
0
def test_histogram_is_needed_unknown():
    # non-supported systematic
    with pytest.raises(NotImplementedError,
                       match="other systematics not yet implemented"):
        configuration.histogram_is_needed({}, {}, {"Type": "unknown"}, "")
예제 #3
0
def test_histogram_is_needed(reg_sam_sys_tem, is_needed):
    reg, sam, sys, tem = reg_sam_sys_tem
    assert configuration.histogram_is_needed(*reg_sam_sys_tem) is is_needed
예제 #4
0
def test_histogram_is_needed_unknown():
    # non-supported systematic
    with pytest.raises(ValueError, match="unknown systematics type: unknown"):
        configuration.histogram_is_needed({}, {}, {"Type": "unknown"}, "")
예제 #5
0
def test_histogram_is_needed(reg_sam_sys_tem, is_needed):
    # could also mock region_contains_sample, region_contains_modifier, and
    # sample_contains_modifier
    reg, sam, sys, tem = reg_sam_sys_tem
    assert configuration.histogram_is_needed(*reg_sam_sys_tem) is is_needed