Пример #1
0
def test_integer_parameter_invalid_step_size(step_size):
    with pytest.raises(ValueError) as e:
        IntegerParameter(default_value=1,
                         lower=0,
                         upper=10,
                         step_size=step_size)
    assert_terms_in_exception(e, ["invalid", "step"])
Пример #2
0
class TestOperator(Operator):
    def run(self, img: Image, ctx: PipelineContext) -> Image:
        return img + 1

    param1 = IntegerParameter(default_value=PARAM1_DEFAULT_VALUE,
                              lower=PARAM1_LOWER,
                              upper=PARAM1_UPPER)
    param2 = DoubleParameter(default_value=PARAM2_DEFAULT_VALUE,
                             lower=PARAM2_LOWER,
                             upper=PARAM2_UPPER)
Пример #3
0
def test_integer_parameter_invalid_lower_upper_limits(limits):
    with pytest.raises(ValueError) as e:
        IntegerParameter(default_value=5, lower=limits[0], upper=limits[1])
    assert_terms_in_exception(e, ['invalid'])
Пример #4
0
def integer_param():
    return IntegerParameter(default_value=10, lower=5, upper=15)
Пример #5
0
def test_integer_parameter_valid_lower_upper_limits(limits):
    IntegerParameter(default_value=5, lower=limits[0], upper=limits[1])
Пример #6
0
def test_integer_parameter_valid_step_size(step_size):
    IntegerParameter(default_value=1, lower=0, upper=10, step_size=step_size)
Пример #7
0
def test_integer_parameter_invalid_default_value(default_value):
    with pytest.raises(ValueError) as e:
        IntegerParameter(default_value=default_value, lower=0, upper=10)
    assert_terms_in_exception(e, ['invalid', 'default'])
Пример #8
0
def test_integer_parameter_valid_default_value(default_value):
    IntegerParameter(default_value=default_value, lower=0, upper=10)