Example #1
0
def test_moran_process_sample(maximum, n, start):
    instance = MoranProcess(maximum)
    s = instance.sample(n, start)
    assert len(s) <= n
    states = list(range(maximum + 1))
    for state in s:
        assert state in states
Example #2
0
def test_moran_process_str_repr(maximum):
    instance = MoranProcess(maximum)
    assert isinstance(repr(instance), str)
    assert isinstance(str(instance), str)
Example #3
0
def test_moran_process_(n, start_fixture):
    instance = MoranProcess(20)
    with pytest.raises((ValueError, TypeError)):
        s = instance.sample(20, start_fixture)
Example #4
0
def test_moran_process_probability(maximum_fixture):
    with pytest.raises((ValueError, TypeError)):
        instance = MoranProcess(maximum_fixture)
Example #5
0
def test_moran_process_str_repr(n_max):
    instance = MoranProcess(n_max)
    assert isinstance(repr(instance), str)
    assert isinstance(str(instance), str)