Skip to content

Commit

Permalink
Fixing up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
craigmaloney committed Jul 16, 2020
1 parent adb21f4 commit 30346f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest==5.4.2
pytest-cov==2.9.0
pytest==5.4.3
pytest-cov==2.10.0
Sphinx==1.4.1
mock==2.0.0
jupyter==1.0.0
Expand Down
4 changes: 2 additions & 2 deletions tests/data/thermostat_type_1_single_too_many_aux_minutes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datetime,cool_runtime_stg1,cool_runtime_stg2,cool_equiv_runtime,heat_runtime_stg
2011-01-01 07:00:00,0.0,,,57.25,,,0.0,19.0,66.5,73.5,66.0
2011-01-01 08:00:00,0.0,,,57.25,,,0.0,13.0,69.0,76.5,69.5
2011-01-01 09:00:00,0.0,,,57.25,,,0.0,0.0,,76.5,67.5
2011-01-01 10:00:00,0.0,,,57.25,,,0.0,60.0,67.5,75.5,66.0
2011-01-01 10:00:00,0.0,,,57.25,,,0.0,63.0,67.5,75.5,66.0
2011-01-01 11:00:00,0.0,,,57.25,,,0.0,0.0,63.5,77.5,65.0
2011-01-01 12:00:00,0.0,,,57.25,,,0.0,60.0,68.0,76.0,69.0
2011-01-01 13:00:00,0.0,,,57.25,,,0.0,0.0,66.0,75.0,64.5
Expand All @@ -34,7 +34,7 @@ datetime,cool_runtime_stg1,cool_runtime_stg2,cool_equiv_runtime,heat_runtime_stg
2011-01-02 08:00:00,0.0,,,58.333333333333336,,,0.0,39.0,64.5,74.5,66.0
2011-01-02 09:00:00,0.0,,,58.333333333333336,,,0.0,0.0,65.0,73.5,65.5
2011-01-02 10:00:00,0.0,,,58.333333333333336,,,0.0,60.0,63.5,77.5,61.0
2011-01-02 11:00:00,0.0,,,58.333333333333336,,,0.0,61,66.0,75.5,66.0
2011-01-02 11:00:00,0.0,,,58.333333333333336,,,0.0,61.0,66.0,75.5,66.0
2011-01-02 12:00:00,0.0,,,58.333333333333336,,,0.0,,66.0,77.0,66.0
2011-01-02 13:00:00,0.0,,,58.333333333333336,,,0.0,5.0,67.5,73.5,67.0
2011-01-02 14:00:00,0.0,,,58.333333333333336,,,0.0,0.0,69.5,75.0,69.5
Expand Down
8 changes: 8 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,20 @@ def test_thermostat_type_1_get_core_heating_days(thermostat_type_1):
method="year_mid_to_mid")
assert len(core_heating_day_sets) == 5

def test_thermostat_type_1_get_core_heating_days_bad_methods(thermostat_type_1):
with pytest.raises(NotImplementedError) as record:
core_heating_day_sets = thermostat_type_1.get_core_heating_days(
method="bad_method")

def test_thermostat_type_1_get_core_cooling_days(thermostat_type_1):
core_cooling_day_sets = thermostat_type_1.get_core_cooling_days(
method="year_end_to_end")
assert len(core_cooling_day_sets) == 4

def test_thermostat_type_1_get_core_cooling_days_bad_methods(thermostat_type_1):
with pytest.raises(NotImplementedError) as record:
core_cooling_day_sets = thermostat_type_1.get_core_cooling_days(
method="bad_method")

def test_thermostat_type_2_get_core_heating_days(thermostat_type_2):
core_heating_day_sets = thermostat_type_2.get_core_heating_days(
Expand Down
2 changes: 1 addition & 1 deletion thermostat/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def get_resistance_heat_utilization_runtime(self, core_heating_day_set):

self._protect_aux_emerg()

if not(self.has_resistance_heat):
if not self.has_resistance_heat:
return None

in_core_day_set_daily = self._get_range_boolean(
Expand Down

0 comments on commit 30346f5

Please sign in to comment.