Пример #1
0
def test_actual_results_show_options(params):
    """Test that the actual results are the expected ones."""
    res_actual = show_options(**params)
    if ('disp' in params.keys()) and (not params['disp']):
        assert isinstance(res_actual, str)
    else:
        assert res_actual is None
Пример #2
0
def test_actual_results_show_options(params, res_desired):
    """Test that the actual results are the expected ones."""
    res_actual = show_options(disp=True, **params)
    np.testing.assert_equal(res_actual, res_desired)
Пример #3
0
def test_parameter_check_show_options(params):
    """Test parameter validation."""
    err_msg = ("'method' must be either None, 'classic', 'sakoechiba', "
               "'itakura', 'region', 'multiscale' or 'fast'.")
    with pytest.raises(ValueError, match=re.escape(err_msg)):
        show_options(**params)
Пример #4
0
def test_parameter_check_show_options(params, err_msg):
    """Test parameter validation."""
    with pytest.raises(ValueError, match=re.escape(err_msg)):
        show_options(**params)