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
def test_moran_process_str_repr(maximum): instance = MoranProcess(maximum) assert isinstance(repr(instance), str) assert isinstance(str(instance), str)
def test_moran_process_(n, start_fixture): instance = MoranProcess(20) with pytest.raises((ValueError, TypeError)): s = instance.sample(20, start_fixture)
def test_moran_process_probability(maximum_fixture): with pytest.raises((ValueError, TypeError)): instance = MoranProcess(maximum_fixture)
def test_moran_process_str_repr(n_max): instance = MoranProcess(n_max) assert isinstance(repr(instance), str) assert isinstance(str(instance), str)