示例#1
0
def test_cec_benchmark_continuous_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.continuous = 1
    except:
        new_cec_benchmark.continuous = True

    assert new_cec_benchmark.continuous == True
示例#2
0
def test_cec_benchmark_separable_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.separable = 1
    except:
        new_cec_benchmark.separable = True

    assert new_cec_benchmark.separable == True
示例#3
0
def test_cec_benchmark_name_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.name = 1
    except:
        new_cec_benchmark.name = 'F1'

    assert new_cec_benchmark.name == 'F1'
示例#4
0
def test_cec_benchmark_multimodal_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.multimodal = 1
    except:
        new_cec_benchmark.multimodal = True

    assert new_cec_benchmark.multimodal == True
示例#5
0
def test_cec_benchmark_convex_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.convex = 1
    except:
        new_cec_benchmark.convex = True

    assert new_cec_benchmark.convex == True
示例#6
0
def test_cec_benchmark_year_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.year = 1
    except:
        new_cec_benchmark.year = '2005'

    assert new_cec_benchmark.year == '2005'
示例#7
0
def test_cec_benchmark_dims_setter():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    try:
        new_cec_benchmark.dims = 'a'
    except:
        new_cec_benchmark.dims = 1

    assert new_cec_benchmark.dims == 1

    try:
        new_cec_benchmark.dims = 0
    except:
        new_cec_benchmark.dims = 1

    assert new_cec_benchmark.dims == 1
示例#8
0
def test_cec_benchmark_convex():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.convex == False
示例#9
0
def test_cec_benchmark_continuous():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.continuous == False
示例#10
0
def test_cec_benchmark_name():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.name == 'F1'
示例#11
0
def test_cec_benchmark_dims():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.dims == 1
示例#12
0
def test_cec_benchmark_year():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.year == '2005'
示例#13
0
def test_cec_benchmark_load_auxiliary_data():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    new_cec_benchmark._load_auxiliary_data('F1', '2005', 'o')

    assert new_cec_benchmark.o.shape == (100,)
示例#14
0
def test_cec_benchmark_call():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    with pytest.raises(NotImplementedError):
        new_cec_benchmark(None)
示例#15
0
def test_cec_benchmark_separable():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.separable == False
示例#16
0
def test_cec_benchmark_differentiable():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.differentiable == False
示例#17
0
def test_cec_benchmark_multimodal():
    new_cec_benchmark = cec_benchmark.CECBenchmark('F1', '2005')

    assert new_cec_benchmark.multimodal == False