コード例 #1
0
ファイル: test_run.py プロジェクト: davidlibland/mutatest
def test_get_mutation_sample_locations(popsize, nlocs, nexp, mock_LocIdx):
    """Test sample size draws for the mutation sample."""
    mock_src_file = Path("source.py")
    mock_sample = [GenomeGroupTarget(*i) for i in [(mock_src_file, mock_LocIdx)] * popsize]

    result = run.get_mutation_sample_locations(mock_sample, nlocs)
    assert len(result) == nexp
コード例 #2
0
ファイル: test_run.py プロジェクト: davidlibland/mutatest
def test_get_mutation_sample_locations_ValueError(nloc, mock_LocIdx):
    """Zero and negative integer sample sizes raise a value error."""
    ggt = [GenomeGroupTarget(Path("src.py"), mock_LocIdx)]

    with pytest.raises(ValueError):
        _ = run.get_mutation_sample_locations(ggt, nloc)