File size: 806 Bytes
d1c6c9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest
from noulith.protocols import root_profile, partition_valuations
from noulith.geometry import line_arrangement_generators, perfect_slice_matrix


@pytest.mark.parametrize('args',[(1.2,1,2),(1,1.0,2),(1,1,2.5),(True,1,2),(-1,1,2),(1,-1,2),(1,1,1)])
def test_root_profile_rejects_invalid_arguments(args):
    with pytest.raises(ValueError):
        root_profile(*args)


@pytest.mark.parametrize('budget',[1.0,-1,True,'2'])
def test_dp_rejects_invalid_budget(budget):
    with pytest.raises(ValueError):
        partition_valuations([0,0],budget)


def test_branch_normal_form_rejects_three_channel_exception():
    import sympy as sp
    with pytest.raises(ValueError):
        line_arrangement_generators(sp.symbols('x y'))
    with pytest.raises(ValueError):
        perfect_slice_matrix(2)