def test_unfeasible_problem_01__error_dry(study_path, check_runner):
    errors_on_weeks = []
    errors_on_weeks.append(weeks_in_year(year=3, weeks=[19]))

    checks = check_list()
    checks.add(
        check=unfeasible_problem(study_path,
                                 new_behavior="error-dry",
                                 checks_on_weeks=errors_on_weeks,
                                 simulation=check_runner.get_simulation()))
    check_runner.run(checks)
def test_unfeasible_problem_01__warning_dry(study_path, check_runner):
    warnings_on_weeks = []
    warnings_on_weeks.append(weeks_in_year(year=3, weeks=[19]))
    warnings_on_weeks.append(weeks_in_year(year=6, weeks=[42, 43, 49]))
    warnings_on_weeks.append(weeks_in_year(year=7, weeks=[19]))
    warnings_on_weeks.append(weeks_in_year(year=8, weeks=[19]))

    checks = check_list()
    checks.add(
        check=unfeasible_problem(study_path,
                                 new_behavior="warning-dry",
                                 checks_on_weeks=warnings_on_weeks,
                                 simulation=check_runner.get_simulation()))
    check_runner.run(checks)
def create_unfeasible_problem(study_path, parameters = {}, simulation = None):
    behavior = parameters["behavior"]
    weeks = make_list_of_weeks(parameters["weeks_in_year"])
    return unfeasible_problem(study_path, behavior, weeks, simulation)