Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Sep 5, 2023
1 parent 9f77c6a commit 89e0f5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/test_energy_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ def test_aux_power():
)
aux = ecm.aux_energy_per_km(aux_power=np.array([100]), efficiency=np.array([0.5]))
assert isinstance(aux, np.ndarray)
assert aux.reshape(ecm.cycle.shape).shape == ecm.cycle.shape
assert np.allclose(aux, np.repeat(100 / 0.5, 1801))
assert np.allclose(aux, np.repeat(100 / 0.5, 3144))
4 changes: 2 additions & 2 deletions tests/test_vehicle_input_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def test_can_pass_directly():
d, e = json.load(open(DEFAULT)), set(json.load(open(EXTRA)))
e.remove("foobazzle")
assert len(vip.CarInputParameters(d, e).powertrains) == 12
assert len(vip.CarInputParameters(d, e).parameters) == 333
assert len(vip.CarInputParameters(d, e).parameters) == 332


def test_alternate_filepath():
assert len(vip.CarInputParameters(DEFAULT, EXTRA).powertrains) == 12
assert len(vip.CarInputParameters(DEFAULT, EXTRA).parameters) == 333
assert len(vip.CarInputParameters(DEFAULT, EXTRA).parameters) == 332

0 comments on commit 89e0f5b

Please sign in to comment.