Пример #1
0
def test_rs_initialize2():

    sp = Searchspace(argument_param=("DISCRETE", [1, 5]))

    rs = RandomSearch(5, sp, [])

    with pytest.raises(NotImplementedError) as excinfo:
        rs.initialize()
    assert "Searchspace needs at least one continuous parameter" in str(excinfo.value)
Пример #2
0
def test_randomsearch_initialize():

    sp = Searchspace(argument_param=("DOUBLE", [1, 5]), param2=("integer", [3, 4]))

    rs = RandomSearch(5, sp, [])

    rs.initialize()

    assert len(rs.trial_buffer) == 5