def test_params(weights): p = {'weights': weights, 'dither': 0.1} assert BottleneckProcessor(**p).get_params() == p b = BottleneckProcessor() assert b.weights == 'BabelMulti' b.set_params(**p) assert BottleneckProcessor(**p).get_params() == p assert b.weights == weights
def test_bad_params(): w = 'BadWeights' with pytest.raises(ValueError) as err: BottleneckProcessor(w) assert 'invalid weights' in str(err.value) b = BottleneckProcessor() with pytest.raises(ValueError) as err: b.set_params(**{'weights': w}) assert 'invalid weights' in str(err.value)