from pathlib import Path import sys import pytest SCRIPTS = Path(__file__).resolve().parents[1] / "scripts" sys.path.insert(0, str(SCRIPTS)) from heat_compute_metrics import estimate_captured_heat, heat_reuse_factor # noqa: E402 def test_estimates_captured_heat_from_it_energy_and_capture_factor(): captured = estimate_captured_heat( it_energy_kwh=1000, capture_factor=0.9, ) assert captured == pytest.approx(900) def test_heat_reuse_factor_counts_only_heat_delivered_to_a_real_host(): reuse = heat_reuse_factor( heat_delivered_to_host_kwh=450, heat_rejected_kwh=900, ) assert reuse == pytest.approx(0.5)