'Test bounding box evaluation'

def test_bounding_box1D(self, model_class, test_parameters):

    model = create_model(model_class, test_parameters)
    model.bounding_box = ((-5), 5)
    model.bounding_box = None
    with pytest.raises(NotImplementedError):
        model.bounding_box
    del model.bounding_box
    with pytest.raises(ValueError):
        model.bounding_box = 5
    try:
        bbox = model.bounding_box
    except NotImplementedError:
        pytest.skip(u'Bounding_box    is    not    defined    for    model.')
    if isinstance(model, models.Lorentz1D):
        rtol = 0.01
        ddx = 0.1
    else:
        rtol = 1e-07
        ddx = 1
    dx = (np.diff(bbox) / 2)
    x1 = np.mgrid[slice(bbox[0], (bbox[1] + 1), ddx)]
    x2 = np.mgrid[slice((bbox[0] - dx), ((bbox[1] + dx) + 1), ddx)]
    arr = model(x2)
    sub_arr = model(x1)
    assert (abs((arr.sum() - sub_arr.sum())) < (arr.sum() * rtol))
