Ejemplo n.º 1
0
def test_some_mutation():
    for rate in (.25, .5, .75):
        mask = list(mutation.mutation_rate(rate)(100))
        assert len(mask) == 100
        values = set()
        for m in mask:
            values.add(m)
        assert True in values and False in values
Ejemplo n.º 2
0
def test_some_mutation():
    for rate in (.25, .5, .75):
        mask = list(mutation.mutation_rate(rate)(100))
        assert len(mask) == 100
        values = set()
        for m in mask:
            values.add(m)
        assert True in values and False in values
Ejemplo n.º 3
0
def test_all_mutation():
    mask = list(mutation.mutation_rate(1)(100))
    assert len(mask) == 100
    for m in mask:
        assert m is True
Ejemplo n.º 4
0
def test_no_mutation():
    mask = list(mutation.mutation_rate(0)(100))
    assert len(mask) == 100
    for m in mask:
        assert m is False
Ejemplo n.º 5
0
def test_all_mutation():
    mask = list(mutation.mutation_rate(1)(100))
    assert len(mask) == 100
    for m in mask:
        assert m is True
Ejemplo n.º 6
0
def test_no_mutation():
    mask = list(mutation.mutation_rate(0)(100))
    assert len(mask) == 100
    for m in mask:
        assert m is False