Beispiel #1
0
def test_benchmark_differentiable_setter():
    new_benchmark = benchmark.Benchmark()

    try:
        new_benchmark.differentiable = 1
    except:
        new_benchmark.differentiable = True

    assert new_benchmark.differentiable == True
Beispiel #2
0
def test_benchmark_convex_setter():
    new_benchmark = benchmark.Benchmark()

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

    assert new_benchmark.convex == True
Beispiel #3
0
def test_benchmark_separable_setter():
    new_benchmark = benchmark.Benchmark()

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

    assert new_benchmark.separable == True
Beispiel #4
0
def test_benchmark_continuous_setter():
    new_benchmark = benchmark.Benchmark()

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

    assert new_benchmark.continuous == True
Beispiel #5
0
def test_benchmark_name_setter():
    new_benchmark = benchmark.Benchmark()

    try:
        new_benchmark.name = 1
    except:
        new_benchmark.name = 'name'

    assert new_benchmark.name == 'name'
Beispiel #6
0
def test_benchmark_multimodal_setter():
    new_benchmark = benchmark.Benchmark()

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

    assert new_benchmark.multimodal == True
Beispiel #7
0
def test_benchmark_dims_setter():
    new_benchmark = benchmark.Benchmark()

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

    assert new_benchmark.dims == 1

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

    assert new_benchmark.dims == 1
Beispiel #8
0
def test_benchmark_multimodal():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.multimodal == False
Beispiel #9
0
def test_benchmark_differentiable():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.differentiable == False
Beispiel #10
0
def test_benchmark_convex():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.convex == False
Beispiel #11
0
def test_benchmark_name():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.name == 'Benchmark'
Beispiel #12
0
def test_benchmark_continuous():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.continuous == False
Beispiel #13
0
def test_benchmark_dims():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.dims == 1
Beispiel #14
0
def test_benchmark_call():
    new_benchmark = benchmark.Benchmark()

    with pytest.raises(NotImplementedError):
        new_benchmark(None)
Beispiel #15
0
def test_benchmark_separable():
    new_benchmark = benchmark.Benchmark()

    assert new_benchmark.separable == False