@@ -53,6 +53,23 @@ def __init__(
53
53
solver : Optional [mip .Solver ] = None ,
54
54
):
55
55
"""Model constructor
56
+ tests/unit/test_portfolio_optimisation/hs/execution/reports/test_aantal_ibn_report.py:29 (TestCaseAantalIBNReport.test_aantal_ibn_vraag_overview)
57
+ 2 != 3
58
+
59
+ Expected :3
60
+ Actual :2
61
+ <Click to see difference>
62
+
63
+ cls = <class 'tests.unit.test_portfolio_optimisation.hs.execution.reports.test_aantal_ibn_report.TestCaseAantalIBNReport'>
64
+
65
+ @classmethod
66
+ def setUp(cls):
67
+ cls.portfolio = dummy_hs_portfolio()
68
+ > model, result = optimize_plan(cls.portfolio)
69
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70
+
71
+ tests/unit/test_portfolio_optimisation/hs/execution/reports/test_aantal_ibn_report.py:27: AssertionError
72
+
56
73
57
74
Creates a Mixed-Integer Linear Programming Model. The default model
58
75
optimization direction is Minimization. To store and optimize the model
@@ -471,7 +488,7 @@ def constr_by_name(self: "Model", name: str) -> Optional["mip.Constr"]:
471
488
constraint or None if not found
472
489
"""
473
490
cidx = self .solver .constr_get_index (name )
474
- if cidx < 0 or cidx > len (self .constrs ):
491
+ if cidx < 0 or cidx >= len (self .constrs ):
475
492
return None
476
493
return self .constrs [cidx ]
477
494
@@ -484,7 +501,7 @@ def var_by_name(self: "Model", name: str) -> Optional["mip.Var"]:
484
501
Variable or None if not found
485
502
"""
486
503
v = self .solver .var_get_index (name )
487
- if v < 0 or v > len (self .vars ):
504
+ if v < 0 or v >= len (self .vars ):
488
505
return None
489
506
return self .vars [v ]
490
507
0 commit comments