2024-10-02 22:00:05 +02:00
|
|
|
import pytest
|
2024-10-03 11:05:44 +02:00
|
|
|
|
2024-10-02 22:00:05 +02:00
|
|
|
from modules.class_heatpump import Heatpump
|
|
|
|
|
|
|
|
|
2024-10-03 11:05:44 +02:00
|
|
|
@pytest.fixture(scope="function")
|
2024-10-02 22:00:05 +02:00
|
|
|
def heatpump() -> Heatpump:
|
2024-10-03 11:05:44 +02:00
|
|
|
"""Heatpump with 5 kw heating power and 24 h prediction"""
|
2024-10-02 22:00:05 +02:00
|
|
|
return Heatpump(5000, 24)
|
|
|
|
|
2024-10-03 11:05:44 +02:00
|
|
|
|
2024-10-02 22:00:05 +02:00
|
|
|
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"
|