Ejemplo n.º 1
0
def test__fetch_crossover_config_emptyDict_returnsDefaultSettings():
    cross_config = {}
    config = Config()

    config._fetch_crossover_config(cross_config)

    assert (config.constant_length is True and config.initial_length == 0
            and config.max_genes == 0)
Ejemplo n.º 2
0
def test__fetch_crossover_config_validData_fetchesValidVariables():
    cross_config = {
        "constant_length": False,
        "initial_genes": 1,
        "max_genes": 1
    }
    config = Config()

    config._fetch_crossover_config(cross_config)

    assert (config.constant_length is False and config.initial_length == 1
            and config.max_genes == 1)