Skip to content

Commit

Permalink
Merge pull request #100 from zach401/test_interface_refactor
Browse files Browse the repository at this point in the history
Refactor test_interface to add constraints using built-in functions.
  • Loading branch information
sunash committed Jun 18, 2021
2 parents 1ef0d9e + 524227b commit 3c76892
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acnportal/acnsim/tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
InvalidScheduleError,
FiniteRatesEVSE,
DeadbandEVSE,
Current,
)
from acnportal.acnsim.interface import SessionInfo, InfrastructureInfo, Constraint
from acnportal.acnsim.models import EVSE
Expand Down Expand Up @@ -272,9 +273,8 @@ def setUp(self) -> None:
self.allowable_rates: List[int] = [0, 8, 16, 24, 32]
evse4: FiniteRatesEVSE = FiniteRatesEVSE("PS-004", self.allowable_rates)
self.network.register_evse(evse4, 120, -30)
self.network.constraint_matrix = np.eye(4)
self.network.magnitudes = np.ones((4, 1))
self.network.constraint_index = ["C1", "C2", "C3", "C4"]
for i, station_id in enumerate(self.network.station_ids):
self.network.add_constraint(Current(station_id), 1, f"C{i+1}")

def test_init(self) -> None:
self.assertIs(self.interface._simulator, self.simulator)
Expand Down

0 comments on commit 3c76892

Please sign in to comment.