Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliette-Gerbaux committed Aug 2, 2024
1 parent 8a0fe98 commit dec3bd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/andromede/thermal_heuristic/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ def __init__(
def solve(
self,
solver_parameters: pywraplp.MPSolverParameters = pywraplp.MPSolverParameters(),
expected_status: str = pywraplp.Solver.OPTIMAL,
) -> None:
status = self.problem.solver.Solve(solver_parameters)

self.output = OutputValues(self.problem)
self.objective = self.problem.solver.Objective().Value()

assert status == pywraplp.Solver.OPTIMAL
assert status == expected_status


class ConnectionBetweenResolutionSteps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from pathlib import Path

import ortools.linear_solver.pywraplp as pywraplp
import pytest

from andromede.libs.standard import (
Expand Down Expand Up @@ -190,7 +191,7 @@ def test_accurate_heuristic(data_path: str) -> None:
week=0,
scenario=0,
)
resolution_step_2.solve()
resolution_step_2.solve(expected_status=pywraplp.Solver.INFEASIBLE)


def test_fast_heuristic(data_path: str) -> None:
Expand Down Expand Up @@ -256,4 +257,4 @@ def test_fast_heuristic(data_path: str) -> None:
week=0,
scenario=0,
)
resolution_step_2.solve()
resolution_step_2.solve(expected_status=pywraplp.Solver.INFEASIBLE)

0 comments on commit dec3bd5

Please sign in to comment.