Ejemplo n.º 1
0
def test_valid_check_init_random_population():
    ga = BinaryGA(list(range(5)), fitness_test_func)

    max_num = ga._check_init_random_population(15)
    assert max_num == 2**5
Ejemplo n.º 2
0
def test_invalid_check_init_random_population(size):
    ga = BinaryGA(list(range(5)), fitness_test_func)

    with pytest.raises(ValueError):
        ga._check_init_random_population(size)
Ejemplo n.º 3
0
def test_invalid_check_init_random_population(size):
    ga = BinaryGA(list(range(5)), fitness_test_func)

    with pytest.raises(ValueError):
        ga._check_init_random_population(size)
Ejemplo n.º 4
0
def test_valid_check_init_random_population():
    ga = BinaryGA(list(range(5)), fitness_test_func)

    max_num = ga._check_init_random_population(15)
    assert max_num == 2**5