示例#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
示例#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
示例#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
示例#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
示例#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'
示例#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
示例#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
示例#8
0
def test_benchmark_multimodal():
    new_benchmark = benchmark.Benchmark()

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

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

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

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

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

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

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

    assert new_benchmark.separable == False