mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-09-13 07:21:16 +00:00
Add first unit test for heatpump COP calculation
This commit is contained in:
1
tests/conftest.py
Normal file
1
tests/conftest.py
Normal file
@@ -0,0 +1 @@
|
||||
from test_heatpump import heatpump
|
16
tests/test_heatpump.py
Normal file
16
tests/test_heatpump.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
from modules.class_heatpump import Heatpump
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def heatpump() -> Heatpump:
|
||||
""" Heatpump with 5 kw heating power and 24 h prediction
|
||||
"""
|
||||
return Heatpump(5000, 24)
|
||||
|
||||
class TestHeatpump:
|
||||
def test_cop(self, heatpump):
|
||||
"""Testing calculate COP for variouse outside temperatures"""
|
||||
assert heatpump.cop_berechnen(-10) == 2.0, "COP for -10 degree isn't correct"
|
||||
assert heatpump.cop_berechnen(0) == 3.0, "COP for 0 degree isn't correct"
|
||||
assert heatpump.cop_berechnen(10) == 4.0, "COP for 10 degree isn't correct"
|
Reference in New Issue
Block a user