-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hot_water): Add 'temp' attribute to hot-water recirc
- Adds new 'water_temp' attribute for all piping - Refactors hot-water - Add __eq__ to _Base for testing - Add tests
- Loading branch information
Showing
6 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/test_honeybee_energy_ph/test_hvac/test_hot_water_tank.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from honeybee_energy_ph.hvac.hot_water import PhSHWTank | ||
|
||
def test_dict_roundtrip_PhSHWTank(): | ||
s1 = PhSHWTank() | ||
d = s1.to_dict() | ||
|
||
s2 = PhSHWTank.from_dict(d) | ||
assert s2.to_dict() == d | ||
|
||
# -- add user data | ||
s2.user_data["test_key"] = "test_value" | ||
assert "test_key" in s2.user_data | ||
assert "test_key" not in s1.user_data | ||
assert s1.to_dict() != s2.to_dict() | ||
|
||
def test_duplicate_PhSHWTank(): | ||
t1 = PhSHWTank() | ||
t2 = t1.duplicate() | ||
assert t1 == t2 | ||
assert t1.to_dict() == t2.to_dict() | ||
assert t1 is not t2 | ||
assert t1.user_data is not t2.user_data | ||
assert t1.user_data == t2.user_data | ||
|
Empty file.
38 changes: 38 additions & 0 deletions
38
tests/test_honeybee_energy_ph/test_properties/test_hot_water/test_sys_ph_prop.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from honeybee_energy_ph.properties.hot_water.hw_system import SHWSystemPhProperties | ||
from honeybee_energy_ph.hvac.hot_water import PhSHWTank, PhPipeElement | ||
|
||
def test_basic_SHWSystemPhProperties_round_trip(): | ||
obj = SHWSystemPhProperties(None) | ||
d = obj.to_dict() | ||
new_obj = SHWSystemPhProperties.from_dict(d['ph'], None) | ||
assert new_obj.to_dict() == d | ||
|
||
|
||
def test_SHWSystemPhProperties_copy(): | ||
system = SHWSystemPhProperties(None) | ||
system.id_num = 1 | ||
system.tank_1 = PhSHWTank() | ||
system.tank_2 = PhSHWTank() | ||
system.tank_buffer = PhSHWTank() | ||
system.tank_solar = PhSHWTank() | ||
system._heaters = {'heater_1': 1, 'heater_2': 2} | ||
system._branch_piping = {'branch_1': PhPipeElement(), 'branch_2': PhPipeElement()} | ||
system._recirc_piping = {'recirc_1': PhPipeElement(), 'recirc_2': PhPipeElement()} | ||
system._number_tap_points = 2 | ||
system.recirc_temp = 50 | ||
system.recirc_hours = 2 | ||
|
||
new_system = system.__copy__() | ||
|
||
assert new_system.id_num == system.id_num | ||
assert new_system.tank_1 == system.tank_1 | ||
assert new_system.tank_2 == system.tank_2 | ||
assert new_system.tank_buffer == system.tank_buffer | ||
assert new_system.tank_solar == system.tank_solar | ||
assert new_system._heaters == system._heaters | ||
assert new_system._branch_piping == system._branch_piping | ||
assert new_system._recirc_piping == system._recirc_piping | ||
assert new_system._number_tap_points == system._number_tap_points | ||
assert new_system.recirc_temp == system.recirc_temp | ||
assert new_system.recirc_hours == system.recirc_hours | ||
|